aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dom_utils.coffee8
-rw-r--r--lib/keyboard_utils.coffee5
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index 95b9f4b3..67d5a44c 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -363,8 +363,12 @@ DomUtils =
@remove() if event.target == window
handlerStack.continueBubbling
callback?()
- @suppressEvent event
- handlerStack.suppressEvent
+ if suppressPropagation
+ DomUtils.suppressPropagation event
+ handlerStack.suppressPropagation
+ else
+ DomUtils.suppressEvent event
+ handlerStack.suppressEvent
# Polyfill for selection.type (which is not available in Firefox).
getSelectionType: (selection = document.getSelection()) ->
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index 70aa5a95..09623e50 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -36,6 +36,8 @@ KeyboardUtils =
""
else if key of @keyNames
@keyNames[key]
+ else if @isModifier event
+ "" # Don't resolve modifier keys.
else if key.length == 1
key
else
@@ -70,6 +72,9 @@ KeyboardUtils =
isPrintable: (event) ->
@getKeyCharString(event)?.length == 1
+ isModifier: (event) ->
+ event.key in ["Control", "Shift", "Alt", "OS", "AltGraph", "Meta"]
+
enUsTranslations:
"Backquote": ["`", "~"]
"Minus": ["-", "_"]