Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
peach-html5-editor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
19c204b
)
fix typing several symbols
author
Jason Woofenden
<jason@jasonwoof.com>
Sun, 13 Mar 2016 18:46:33 +0000
(14:46 -0400)
committer
Jason Woofenden
<jason@jasonwoof.com>
Sun, 13 Mar 2016 18:46:33 +0000
(14:46 -0400)
editor.coffee
patch
|
blob
|
history
diff --git
a/editor.coffee
b/editor.coffee
index
72ec0c6
..
8bc72ef
100644
(file)
--- a/
editor.coffee
+++ b/
editor.coffee
@@
-251,7
+251,15
@@
outer_css = (args) ->
ret += '}'
return ret
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
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
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
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]?
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
char = e.charCode ? e.keyCode
if char and @cursor?
char = String.fromCharCode char