mirror of
https://github.com/TangSengDaoDao/TangSengDaoDaoWeb
synced 2025-06-02 15:23:37 +00:00
fix: 🐛修复截图esc快捷键冲突
This commit is contained in:
parent
839d434f75
commit
150247343a
@ -251,13 +251,6 @@ function regShortcut() {
|
||||
);
|
||||
screenshots.startCapture();
|
||||
});
|
||||
|
||||
globalShortcut.register("esc", () => {
|
||||
if (screenshots.$win?.isFocused()) {
|
||||
screenshots.endCapture();
|
||||
}
|
||||
});
|
||||
|
||||
// 打开所有窗口控制台
|
||||
globalShortcut.register("ctrl+shift+i", () => {
|
||||
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) => {
|
||||
let filename = tmp.tmpNameSync() + '.png';
|
||||
|
@ -11002,7 +11002,7 @@ react-draggable@^4.0.3:
|
||||
clsx "^1.1.1"
|
||||
prop-types "^15.8.1"
|
||||
|
||||
react-error-overlay@^6.0.11:
|
||||
react-error-overlay@6.0.11, react-error-overlay@^6.0.11:
|
||||
version "6.0.11"
|
||||
resolved "https://registry.npmmirror.com/react-error-overlay/-/react-error-overlay-6.0.11.tgz#92835de5841c5cf08ba00ddd2d677b6d17ff9adb"
|
||||
integrity sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==
|
||||
|
Loading…
x
Reference in New Issue
Block a user