JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix typing several symbols
authorJason Woofenden <jason@jasonwoof.com>
Sun, 13 Mar 2016 18:46:33 +0000 (14:46 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Sun, 13 Mar 2016 18:46:33 +0000 (14:46 -0400)
editor.coffee

index 72ec0c6..8bc72ef 100644 (file)
@@ -251,7 +251,15 @@ outer_css = (args) ->
        ret += '}'
        return ret
 
-# key codes:
+
+ignore_key_codes =
+       '18': true # alt
+       '20': true # capslock
+       '17': true # ctrl
+       '144': true # numlock
+       '16': true # shift
+       '91': true # windows "start" key
+# key codes: (valid on keydown, not keypress)
 KEY_LEFT = 37
 KEY_UP = 38
 KEY_RIGHT = 39
@@ -266,14 +274,6 @@ KEY_INSERT = 45
 KEY_PAGE_UP = 33
 KEY_PAGE_DOWN = 34
 KEY_TAB = 9
-
-ignore_key_codes =
-       '18': true # alt
-       '20': true # capslock
-       '17': true # ctrl
-       '144': true # numlock
-       '16': true # shift
-       '91': true # windows "start" key
 control_key_codes = # we react to these, but they aren't typing
        '37': KEY_LEFT
        '38': KEY_UP
@@ -742,7 +742,7 @@ class PeachHTML5Editor
        onkeypress: (e) ->
                return if e.ctrlKey
                return false if ignore_key_codes[e.keyCode]?
-               return false if control_key_codes[e.keyCode]? # handled in keydown
+               # return false if control_key_codes[e.keyCode]? # handled in keydown
                char = e.charCode ? e.keyCode
                if char and @cursor?
                        char = String.fromCharCode char