aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStephen Blott2015-01-22 11:39:21 +0000
committerStephen Blott2015-01-22 14:15:43 +0000
commitd7b416747e5cf6971737a3f70243618419a1ac4b (patch)
tree2e7aae49e1f345768ceb27eb2afe9ba677992f37 /lib
parentdd9b2e9550a48c8e6e7a4a56b530ac8060279b12 (diff)
downloadvimium-d7b416747e5cf6971737a3f70243618419a1ac4b.tar.bz2
Visual/edit modes: further development.
- Better abstraction. - Add HUD message on yank. - Require initial selection for visual mode. - Try to start with a visible selection. - Scroll the active end of the selection into view (with smooth scrolling, if enabled).
Diffstat (limited to 'lib')
-rw-r--r--lib/keyboard_utils.coffee7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index 30d99656..02c26610 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -59,7 +59,12 @@ KeyboardUtils =
# 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
+ keyChar =
+ if event.type == "keypress"
+ String.fromCharCode event.charCode
+ else
+ @getKeyChar event
+ keyChar.length == 1
KeyboardUtils.init()