diff --git a/release/antos-1.2.0.tar.gz b/release/antos-1.2.0.tar.gz new file mode 100644 index 0000000..5c45dfb Binary files /dev/null and b/release/antos-1.2.0.tar.gz differ diff --git a/src/core/BaseApplication.ts b/src/core/BaseApplication.ts index 68111ad..97ca0fb 100644 --- a/src/core/BaseApplication.ts +++ b/src/core/BaseApplication.ts @@ -252,11 +252,11 @@ namespace OS { * * @param {string} fnk meta or modifier key e.g. `CTRL`, `ALT`, `SHIFT` or `META` * @param {string} c a regular key - * @param {JQuery.KeyboardEventBase} e JQuery keyboard event + * @param {JQuery.KeyDownEvent} e JQuery keyboard event * @returns {boolean} return whether the shortcut is executed * @memberof BaseApplication */ - shortcut(fnk: string, c: string, e: JQuery.KeyUpEvent): boolean { + shortcut(fnk: string, c: string, e: JQuery.KeyDownEvent): boolean { if (!this.keycomb[fnk]) { return true; } diff --git a/src/core/BaseDialog.ts b/src/core/BaseDialog.ts index a1d4d42..791531c 100644 --- a/src/core/BaseDialog.ts +++ b/src/core/BaseDialog.ts @@ -63,6 +63,7 @@ namespace OS { */ quit(): void { const evt = new BaseEvent("exit", false); + this.onexit(evt); if (!evt.prevent) { delete this._observable; if (this.scheme) { @@ -71,7 +72,6 @@ namespace OS { if (this.dialog) { return this.dialog.quit(); } - this.onexit(evt); } } diff --git a/src/core/gui.ts b/src/core/gui.ts index c6a4905..fe5567b 100644 --- a/src/core/gui.ts +++ b/src/core/gui.ts @@ -43,7 +43,7 @@ namespace OS { * * @memberof ShortcutType */ - [propName: string]: GenericObject<(e: JQuery.KeyUpEvent) => void>; + [propName: string]: GenericObject<(e: JQuery.KeyDownEvent) => void>; } /** @@ -734,13 +734,13 @@ namespace OS { * * @export * @param {string} k the hotkey e.g. `ALT-C` - * @param {(e: JQuery.MouseDownEvent) => void} f handle function + * @param {(e: JQuery.KeyPressEvent) => void} f handle function * @param {boolean} force force to rebind the hotkey * @returns {void} */ export function bindKey( k: string, - f: (e: JQuery.KeyUpEvent) => void, + f: (e: JQuery.KeyDownEvent) => void, force: boolean = true ): void { const arr = k.toUpperCase().split("-"); @@ -815,7 +815,6 @@ namespace OS { if (arr.length > 1) { tip = arr[1]; } - console.log(el); const offset = $(el).offset(); const w = $(el).width(); const h = $(el).height(); @@ -903,7 +902,7 @@ namespace OS { $("#wrapper").append(scheme); announcer.observable.one("sysdockloaded", () => { - $(window).on("keyup", function (event) { + $(window).on("keydown", function (event) { const dock = $("#sysdock")[0] as tag.AppDockTag; if (!dock) { return; @@ -924,7 +923,7 @@ namespace OS { if (event.shiftKey) { fnk += "SHIFT"; } - + console.log(fnk, c); if (fnk == "") { return; } diff --git a/src/core/tags/SystemPanelTag.ts b/src/core/tags/SystemPanelTag.ts index 00e64aa..6aba64f 100644 --- a/src/core/tags/SystemPanelTag.ts +++ b/src/core/tags/SystemPanelTag.ts @@ -325,15 +325,21 @@ namespace OS { { if(!setting.system.startup.pinned) return; - (this.refs.pinned as GUI.tag.MenuTag).items = setting.system.startup.pinned.map((name) => { - const app = setting.system.packages[name]; - return { - icon: app.icon, - iconclass: app.iconclass, - app: app.app, - tooltip: `cb:${app.name}` - }; - }); + (this.refs.pinned as GUI.tag.MenuTag).items = + setting.system.startup.pinned + .filter((el) =>{ + const app = setting.system.packages[el]; + return app && app.app + }) + .map((name) => { + const app = setting.system.packages[name]; + return { + icon: app.icon, + iconclass: app.iconclass, + app: app.app, + tooltip: `cb:${app.name}` + }; + }); } /** diff --git a/src/packages/CodePad/main.ts b/src/packages/CodePad/main.ts index cd374b6..359d2d9 100644 --- a/src/packages/CodePad/main.ts +++ b/src/packages/CodePad/main.ts @@ -361,7 +361,7 @@ namespace OS { this.bindKey("ALT-N", () => this.menuAction("new")); this.bindKey("ALT-O", () => this.menuAction("open")); - this.bindKey("CTRL-ALT-F", () => this.menuAction("opendir")); + this.bindKey("ALT-F", () => this.menuAction("opendir")); this.bindKey("CTRL-S", () => this.menuAction("save")); this.bindKey("ALT-W", () => this.menuAction("saveas")); @@ -792,7 +792,7 @@ namespace OS { { text: __("Open Folder"), dataid: "opendir", - shortcut: "C-A-F", + shortcut: "A-F", }, { text: __("Save"), dataid: "save", shortcut: "C-S" }, {