mirror of
https://github.com/TangSengDaoDao/TangSengDaoDaoWeb
synced 2025-06-06 09:08:59 +00:00
Merge branch 'main' of https://github.com/TangSengDaoDao/TangSengDaoDaoWeb
This commit is contained in:
commit
e99c00df8f
@ -251,13 +251,6 @@ function regShortcut() {
|
|||||||
);
|
);
|
||||||
screenshots.startCapture();
|
screenshots.startCapture();
|
||||||
});
|
});
|
||||||
|
|
||||||
globalShortcut.register("esc", () => {
|
|
||||||
if (screenshots.$win?.isFocused()) {
|
|
||||||
screenshots.endCapture();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 打开所有窗口控制台
|
// 打开所有窗口控制台
|
||||||
globalShortcut.register("ctrl+shift+i", () => {
|
globalShortcut.register("ctrl+shift+i", () => {
|
||||||
let windows = BrowserWindow.getAllWindows();
|
let windows = BrowserWindow.getAllWindows();
|
||||||
@ -383,6 +376,21 @@ app.on("ready", () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 截图添加快捷键esc
|
||||||
|
screenshots.on('windowCreated', ($win) => {
|
||||||
|
$win.on('focus', () => {
|
||||||
|
globalShortcut.register('esc', () => {
|
||||||
|
if ($win?.isFocused()) {
|
||||||
|
screenshots.endCapture();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$win.on('blur', () => {
|
||||||
|
globalShortcut.unregister('esc');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// 点击确定按钮回调事件
|
// 点击确定按钮回调事件
|
||||||
screenshots.on("ok", (e, buffer, bounds) => {
|
screenshots.on("ok", (e, buffer, bounds) => {
|
||||||
let filename = tmp.tmpNameSync() + '.png';
|
let filename = tmp.tmpNameSync() + '.png';
|
||||||
|
@ -242,4 +242,4 @@ export class UserInfoVM extends ProviderListener {
|
|||||||
this.notifyListener();
|
this.notifyListener();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user