summaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-10-04 08:46:11 -0400
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-10-04 08:46:11 -0400
commit7a59568dfc20589c0495235679a96a375e36cfee (patch)
treedecacd78b29c45fb08b34e2e38f00f37d7b6e46e /p
parent91cc88209c710e64cd8a10397e56d006d4566624 (diff)
Fix library with code provided in the comments of the library page.
The fix was given by the owner of the project (I assume) but was never integrated in the code. There is no bug tracker so I couldn't open a ticket. It looks like the project is dead since there is modification to the library.
Diffstat (limited to 'p')
-rw-r--r--p/scripts/shortcut.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/p/scripts/shortcut.js b/p/scripts/shortcut.js
index debaffbaa..4137172c3 100644
--- a/p/scripts/shortcut.js
+++ b/p/scripts/shortcut.js
@@ -43,7 +43,9 @@ shortcut = {
//Find Which key is pressed
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
- var character = String.fromCharCode(code).toLowerCase();
+ if( code == 32 || (code >= 48 && code <= 90) || (code >= 96 && code <= 111) || (code >= 186 && code <= 192) || (code >= 219 && code <= 222)) {
+ var character = String.fromCharCode(code).toLowerCase();
+ }
if(code == 188) character=","; //If the user presses , when the type is onkeydown
if(code == 190) character="."; //If the user presses , when the type is onkeydown