- const date = new Date();
- const ts = Math.round(date.getTime() / 1000);
-
- hotkey_prefix = keychar;
- hotkey_prefix_pressed = ts;
-
- cmdline.innerHTML = keychar;
- Element.show(cmdline);
-
- e.stopPropagation();
-
- // returning false here literally disables ctrl-c in browser lol (because C is a valid prefix)
- return true;
- }
-
- Element.hide(cmdline);
-
- let hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")";
-
- // ensure ^*char notation
- if (e.shiftKey) hotkey = "*" + hotkey;
- if (e.ctrlKey) hotkey = "^" + hotkey;
- if (e.altKey) hotkey = "+" + hotkey;
- if (e.metaKey) hotkey = "%" + hotkey;
-
- hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey;
- hotkey_prefix = false;
-
- let hotkey_action = false;
- var hotkeys = getInitParam("hotkeys");
-
- for (const sequence in hotkeys[1]) {
- if (sequence == hotkey) {
- hotkey_action = hotkeys[1][sequence];
- break;