From cd606b8c28d6e716222b3f455994889f7e59073c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sat, 16 Dec 2017 16:14:12 -0500 Subject: [PATCH] Use cross-platform modifier shortcut for Mousetrap when possible See https://craig.is/killing/mice#api.bind.combo --- client/js/keybinds.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/js/keybinds.js b/client/js/keybinds.js index eb9f51a4..93a431f0 100644 --- a/client/js/keybinds.js +++ b/client/js/keybinds.js @@ -37,10 +37,8 @@ Mousetrap.bind([ }); Mousetrap.bind([ - "command+up", - "command+down", - "ctrl+up", - "ctrl+down", + "mod+up", + "mod+down", ], function(e, keys) { const channels = sidebar.find(".chan"); const index = channels.index(channels.filter(".active")); @@ -77,10 +75,7 @@ const colorsHotkeys = { }; for (const hotkey in colorsHotkeys) { - Mousetrap.bind([ - "command+" + hotkey, - "ctrl+" + hotkey, - ], function(e) { + Mousetrap.bind("mod+" + hotkey, function(e) { e.preventDefault(); const cursorPosStart = input.prop("selectionStart");