瀏覽代碼

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.
Alexis Degrugillier 11 年之前
父節點
當前提交
7a59568dfc
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      p/scripts/shortcut.js

+ 3 - 1
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