diff options
| author | Stephen Blott | 2015-01-10 18:53:28 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-10 18:53:28 +0000 |
| commit | d1c0a5d9bd1f67f2b32a993cfd62bc0b52c44185 (patch) | |
| tree | 76eaa3b86be1c6ac130724168d0bf3bbbb6849c5 /lib/keyboard_utils.coffee | |
| parent | 93de6384632e3e682e02be4cb8cea160997de127 (diff) | |
| parent | 80ad0bc3087a3bf00d61bdd6c9cf48e971e22480 (diff) | |
| download | vimium-d1c0a5d9bd1f67f2b32a993cfd62bc0b52c44185.tar.bz2 | |
Merge branch 'modes-dev' into modes
Diffstat (limited to 'lib/keyboard_utils.coffee')
| -rw-r--r-- | lib/keyboard_utils.coffee | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee index d2a843f9..30d99656 100644 --- a/lib/keyboard_utils.coffee +++ b/lib/keyboard_utils.coffee @@ -55,6 +55,12 @@ KeyboardUtils = # c-[ is mapped to ESC in Vim by default. (event.keyCode == @keyCodes.ESC) || (event.ctrlKey && @getKeyChar(event) == '[') + # TODO. This is probably a poor way of detecting printable characters. However, it shouldn't incorrectly + # identify any of chrome's own keyboard shortcuts as printable. + isPrintable: (event) -> + return false if event.metaKey or event.ctrlKey or event.altKey + @getKeyChar(event)?.length == 1 + KeyboardUtils.init() root = exports ? window |
