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