mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-29 01:02:47 +08:00
:spakles: close with esc
This commit is contained in:
parent
9f21823792
commit
ac1b202f44
@ -13,7 +13,7 @@ import fs from "fs";
|
|||||||
import { LocalDb } from "@/core";
|
import { LocalDb } from "@/core";
|
||||||
import plist from "plist";
|
import plist from "plist";
|
||||||
import { DECODE_KEY } from "@/common/constans/main";
|
import { DECODE_KEY } from "@/common/constans/main";
|
||||||
|
import mainInstance from "../index";
|
||||||
const runnerInstance = runner();
|
const runnerInstance = runner();
|
||||||
const detachInstance = detach();
|
const detachInstance = detach();
|
||||||
const dbInstance = new LocalDb(app.getPath("userData"));
|
const dbInstance = new LocalDb(app.getPath("userData"));
|
||||||
@ -44,8 +44,13 @@ class API {
|
|||||||
if (input.type !== "keyDown") return;
|
if (input.type !== "keyDown") return;
|
||||||
if (!(input.meta || input.control || input.shift || input.alt)) {
|
if (!(input.meta || input.control || input.shift || input.alt)) {
|
||||||
if (input.key === "Escape") {
|
if (input.key === "Escape") {
|
||||||
|
if (this.currentPlugin) {
|
||||||
this.removePlugin(null, window);
|
this.removePlugin(null, window);
|
||||||
|
} else {
|
||||||
|
mainInstance.windowCreator.getWindow().hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,7 @@ import "../common/utils/localConfig";
|
|||||||
import registerySystemPlugin from "./common/registerySystemPlugin";
|
import registerySystemPlugin from "./common/registerySystemPlugin";
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
private windowCreator: { init: () => void; getWindow: () => BrowserWindow };
|
public windowCreator: { init: () => void; getWindow: () => BrowserWindow };
|
||||||
private systemPlugins: any;
|
private systemPlugins: any;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -122,4 +122,4 @@ class App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
new App();
|
export default new App();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user