4 ms·
I can't get "$" or "* a" to activate on my Swedish keyboard, where they're typed option-4 and shift-', respectively. Dealing with keyboard-shortcuts and intern
by kalleboo 14y ago
I can't get "$" or "* a" to activate on my Swedish keyboard, where they're typed option-4 and shift-', respectively.
Dealing with keyboard-shortcuts and international keyboard is hard, I don't think I've ever gotten an app using ctrl-[ to work right.
edit: $ highlights when I type shift-4, while that's actually supposed to produce €
- uvdiv 14y agoOn chrome, 'ctrl-[' triggers a key event with .which, .keyCode, and .charCode all set to 27. 27 is DOM_VK_ESCAPE [1]. On firefox, 'esc' sets .keyCode to 27 [2]. Firefox's 'ctrl-[' sets .which and .charCode to 91 (codepoint for '['), but .keyCode to 0. On both firefox and chrome, plain '[' sets .charCode to 91, as does firefox's 'alt-['. But not 'ctrl-[' on chrome. (which,keyCode,charCode) chrome firefox [ 91 91 91 91 0 91 alt-[ ? 91 0 91 ctrl-[ 27 27 27 91 0 91 esc ? 0 27 0 It's one example out of many, but how do you distinguish such cases, short of enumerating the behavior of every browser (and I guess keyboard layout too)? [1] https://developer.mozilla.org/en/DOM/KeyboardEvent#Virtual_key_codes https://developer.mozilla.org/en/DOM/KeyboardEvent#Virtual_k... [2] I don't know what chrome does, I couldn't convince it to capture an 'esc' or 'alt-['.
- kalleboo 14y agoAnd on my Swedish keyboard you type "[" with alt-8, so when I press ctrl-alt-8, all bets are off.
- natedsaint 14y agoThanks for this, I noticed the same thing on chrome with other tools like codepen.io and wasn't able to figure out why it was happening.