2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-05 23:53:27 +00:00

Adds ability for user to use Meta key instead of alt for keybindings

- includes dynamically updating keybinding list
This commit is contained in:
Matt C
2017-11-04 12:55:28 +00:00
parent d924ede9cf
commit 8b30fdf7f1
4 changed files with 99 additions and 75 deletions

View File

@@ -78,6 +78,7 @@ Manager.prototype.setup = function() {
this.recipe.initialiseOperationDragNDrop();
this.controls.autoBakeChange();
this.seasonal.load();
this.bindings.updateKeybList();
};
@@ -91,7 +92,6 @@ Manager.prototype.initialiseEventListeners = function() {
window.addEventListener("focus", this.window.windowFocus.bind(this.window));
window.addEventListener("statechange", this.app.stateChange.bind(this.app));
window.addEventListener("popstate", this.app.popState.bind(this.app));
window.addEventListener("keydown", this.bindings.parseInput.bind(this.bindings));
// Controls
document.getElementById("bake").addEventListener("click", this.controls.bakeClick.bind(this.controls));
document.getElementById("auto-bake").addEventListener("change", this.controls.autoBakeChange.bind(this.controls));
@@ -166,6 +166,10 @@ Manager.prototype.initialiseEventListeners = function() {
this.addDynamicListener(".option-item select", "change", this.options.selectChange, this.options);
document.getElementById("theme").addEventListener("change", this.options.themeChange.bind(this.options));
//Keybindings
window.addEventListener("keydown", this.bindings.parseInput.bind(this.bindings));
$(document).on("switchChange.bootstrapSwitch", ".option-item input:checkbox#useMetaKey", this.bindings.updateKeybList.bind(this.bindings));
// Misc
document.getElementById("alert-close").addEventListener("click", this.app.alertCloseClick.bind(this.app));
};