keyboard shortcuts WIP

This commit is contained in:
zadam
2019-11-19 23:02:54 +01:00
parent 4bd7438fca
commit 3c4ec7fe1a
6 changed files with 119 additions and 75 deletions

View File

@@ -137,10 +137,7 @@ function bindGlobalShortcut(keyboardShortcut, handler) {
function bindElShortcut($el, keyboardShortcut, handler) {
if (isDesktop()) {
if (isMac()) {
// use CMD (meta) instead of CTRL for all shortcuts
keyboardShortcut = keyboardShortcut.replace("ctrl", "meta");
}
keyboardShortcut = keyboardShortcut.replace("mod", isMac() ? "meta" : "ctrl");
$el.bind('keydown', keyboardShortcut, e => {
handler(e);