Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

set "which" property on events (most examples online check against it)

  • Loading branch information...
commit d26ee3007f4e3952aac36b9f75d4462246e27ad1 1 parent ff23a2b
Leon Sorokin leeoniya authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 jquery.autotype.js
6 jquery.autotype.js
View
@@ -177,9 +177,9 @@
};
// build out 3 event instances for all the steps of a key entry
- var keyDownEvent = $.extend($.Event(), evnt, {type:'keydown', keyCode: code.keyCode, charCode: 0});
- var keyPressEvent = $.extend($.Event(), evnt, {type:'keypress', keyCode: 0, charCode: code.charCode});
- var keyUpEvent = $.extend($.Event(), evnt, {type:'keyup', keyCode: code.keyCode, charCode: 0});
+ var keyDownEvent = $.extend($.Event(), evnt, {type:'keydown', keyCode: code.keyCode, charCode: 0, which: code.keyCode});
+ var keyPressEvent = $.extend($.Event(), evnt, {type:'keypress', keyCode: 0, charCode: code.charCode, which: code.charCode || code.keyCode});
+ var keyUpEvent = $.extend($.Event(), evnt, {type:'keyup', keyCode: code.keyCode, charCode: 0, which: code.keyCode});
// go ahead and trigger the first 2 (down and press)
// a keyup of a modifier shouldn't also re-trigger a keydown
Please sign in to comment.
Something went wrong with that request. Please try again.