From 9ecbf8773e48b474ebeba54132ab68f4700ef3e7 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 30 Jul 2014 16:36:37 -0700 Subject: [PATCH] Better handling of ? for hotkey legend --- src/UI/Hotkeys/Hotkeys.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/UI/Hotkeys/Hotkeys.js b/src/UI/Hotkeys/Hotkeys.js index 272307ee0..6a13fd29d 100644 --- a/src/UI/Hotkeys/Hotkeys.js +++ b/src/UI/Hotkeys/Hotkeys.js @@ -6,16 +6,20 @@ define( 'vent', 'Hotkeys/HotkeysView' ], function ($, vent, HotkeysView) { - $(document).on('keydown', function (e) { - if (e.ctrlKey && e.keyCode === 83) { - vent.trigger(vent.Hotkeys.SaveSettings); - e.preventDefault(); + + $(document).on('keypress', function (e) { + if ($(e.target).is('input') || $(e.target).is('textarea')) { return; } - if (e.shiftKey && e.keyCode === 191) { + if (e.charCode === 63) { vent.trigger(vent.Commands.OpenModalCommand, new HotkeysView()); -// vent.trigger(vent.Hotkeys.ShowHotkeys); + } + }); + + $(document).on('keydown', function (e) { + if (e.ctrlKey && e.keyCode === 83) { + vent.trigger(vent.Hotkeys.SaveSettings); e.preventDefault(); return; }