mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-19 14:19:39 +08:00
Merge branch 'master' of https://github.com/clouDr-f2e/rubick into master
This commit is contained in:
commit
19603cba8d
@ -18,7 +18,7 @@
|
|||||||
之所以做这个工具箱一方面是 utools 本身并未开源,但是公司内部的工具库又无法发布到 utools 插件中,所以为了既要享受 utools 生态又要有定制化需求,我们自己参考 utools 设计,做了 Rubick
|
之所以做这个工具箱一方面是 utools 本身并未开源,但是公司内部的工具库又无法发布到 utools 插件中,所以为了既要享受 utools 生态又要有定制化需求,我们自己参考 utools 设计,做了 Rubick
|
||||||
|
|
||||||
## 安装包
|
## 安装包
|
||||||
* [Rubick Mac OS V0.0.1](https://github.com/clouDr-f2e/rubick/releases/download/v0.0.1-beta/rubick2-0.0.1.pkg)
|
* [Rubick Mac OS V0.0.1](https://github.com/clouDr-f2e/rubick/releases/tag/v0.0.1-beta.2)
|
||||||
|
|
||||||
## 支持能力
|
## 支持能力
|
||||||
|
|
||||||
|
@ -155,32 +155,13 @@ export default function init(mainWindow) {
|
|||||||
// 拾色器
|
// 拾色器
|
||||||
ipcMain.on('start-picker', () => {
|
ipcMain.on('start-picker', () => {
|
||||||
// 开启输入侦测
|
// 开启输入侦测
|
||||||
ioHook.start(false)
|
ioHook.start(false);
|
||||||
|
ioHook.load();
|
||||||
picker.init();
|
picker.init();
|
||||||
|
|
||||||
picker.getWindow().on('close', () => {
|
picker.getWindow().on('close', () => {
|
||||||
ioHook.stop();
|
ioHook.stop();
|
||||||
});
|
ioHook.unload();
|
||||||
|
|
||||||
|
|
||||||
ioHook.on('mousemove', e => {
|
|
||||||
let x = e.x
|
|
||||||
let y = e.y
|
|
||||||
if (!picker.getWindow()) return;
|
|
||||||
let color = "#" + robot.getPixelColor(parseInt(x), parseInt(y));
|
|
||||||
picker.getWindow().setPosition(parseInt(x) - 50, parseInt(y) - 50);
|
|
||||||
picker.getWindow().webContents.send("updatePicker", color);
|
|
||||||
})
|
|
||||||
|
|
||||||
ioHook.on('mouseup', e => {
|
|
||||||
if (e.button === 1) {
|
|
||||||
let x = e.x
|
|
||||||
let y = e.y
|
|
||||||
const color = "#" + robot.getPixelColor(parseInt(x), parseInt(y));
|
|
||||||
clipboard.writeText("#" + robot.getPixelColor(parseInt(x), parseInt(y)));
|
|
||||||
new Notification({ title: 'Rubick 通知', body: `${color} 已保存到剪切板` }).show();
|
|
||||||
closePicker();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let pos = robot.getMousePos();
|
let pos = robot.getMousePos();
|
||||||
@ -196,12 +177,33 @@ export default function init(mainWindow) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
ipcMain.on("closePicker", closePicker);
|
ipcMain.on("closePicker", closePicker);
|
||||||
ioHook.on('mouseup', e => {
|
});
|
||||||
if (e.button === 3) {
|
|
||||||
closePicker()
|
ioHook.on('mousemove', e => {
|
||||||
}
|
let x = e.x
|
||||||
});
|
let y = e.y
|
||||||
|
if (!picker.getWindow()) return;
|
||||||
|
let color = "#" + robot.getPixelColor(parseInt(x), parseInt(y));
|
||||||
|
picker.getWindow().setPosition(parseInt(x) - 50, parseInt(y) - 50);
|
||||||
|
picker.getWindow().webContents.send("updatePicker", color);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ioHook.on('mouseup', e => {
|
||||||
|
if (e.button === 1) {
|
||||||
|
let x = e.x
|
||||||
|
let y = e.y
|
||||||
|
const color = "#" + robot.getPixelColor(parseInt(x), parseInt(y));
|
||||||
|
clipboard.writeText("#" + robot.getPixelColor(parseInt(x), parseInt(y)));
|
||||||
|
new Notification({ title: 'Rubick 通知', body: `${color} 已保存到剪切板` }).show();
|
||||||
|
closePicker();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ioHook.on('mouseup', e => {
|
||||||
|
if (e.button === 3) {
|
||||||
|
closePicker()
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user