Open neocotic opened 11 years ago
I'll keep an eye on this thread; thanks for tackling custom modifier keys again.
I started looking at doing this myself as I found the challenge interesting (repo: hotkeys). I was going to base it on this script but have since found that John Resig himself has already done this but in the form of a jQuery plugin, jQuery.hotkeys. Although I wasn't wanting to depend on jQuery for this functionality since the content scripts interact with the DOM directly right now, I might experiment with using this plugin to suit our needs. I need to make sure that whatever solution is decided upon supports all operating systems and detects shortcuts trigger within input fields.
Also, although not as important at this stage, I can't decide how best to allow the user to configure their modifiers. One option is to do something fancy based on something along these lines or simply use drop down boxes (more likely).
I'm still hoping to find time to work on this soon. Just found a library called [Mousetrap|http://craig.is/killing/mice] that may also be useful.
Cool, thanks Alasdair. Even if template does not end up having fully customizable shortcuts, I'm interested in this JS library :)
Thanks for keeping me in the loop.
On Fri, Jul 12, 2013 at 6:53 AM, Alasdair Mercer notifications@github.comwrote:
I'm still hoping to find time to work on this soon. Just found a library called [Mousetrap|http://craig.is/killing/mice] that may also be useful.
— Reply to this email directly or view it on GitHubhttps://github.com/template-extension/template-chrome/issues/197#issuecomment-20872210 .
Although this was originally raised back in the early days (see #5), keyboard shortcuts were never fully customisable as you couldn't change the modifiers and were restricted to only alphanumeric keys (still probably wise).
However, inspired by user feedback, I'm going to look into doing this... again.
First off, I want Windows, Mac, and Linux users to get a native-feeling experience (i.e. Mac users getting their fancy symbols :wink:). Also, at least one modifier is required and modifiers will be global and covers all templates. The "trigger key" will be the only thing bound to the template, as it is now. Perhaps the only change to the "trigger key" is to loosen its restrictions.
Here's a list of valid modifiers:
Finally, I'll probably create/find one or more external libraries to manage the setting and identification of shortcut modifiers. This would need to be injected as a content script before
content.coffee
.