Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit d26ee3007f4e3952aac36b9f75d4462246e27ad1 1 parent ff23a2b
Leon Sorokin leeoniya authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 jquery.autotype.js
6 jquery.autotype.js
@@ -177,9 +177,9 @@
177 177 };
178 178
179 179 // build out 3 event instances for all the steps of a key entry
180   - var keyDownEvent = $.extend($.Event(), evnt, {type:'keydown', keyCode: code.keyCode, charCode: 0});
181   - var keyPressEvent = $.extend($.Event(), evnt, {type:'keypress', keyCode: 0, charCode: code.charCode});
182   - var keyUpEvent = $.extend($.Event(), evnt, {type:'keyup', keyCode: code.keyCode, charCode: 0});
  180 + var keyDownEvent = $.extend($.Event(), evnt, {type:'keydown', keyCode: code.keyCode, charCode: 0, which: code.keyCode});
  181 + var keyPressEvent = $.extend($.Event(), evnt, {type:'keypress', keyCode: 0, charCode: code.charCode, which: code.charCode || code.keyCode});
  182 + var keyUpEvent = $.extend($.Event(), evnt, {type:'keyup', keyCode: code.keyCode, charCode: 0, which: code.keyCode});
183 183
184 184 // go ahead and trigger the first 2 (down and press)
185 185 // a keyup of a modifier shouldn't also re-trigger a keydown

0 comments on commit d26ee30

Please sign in to comment.
Something went wrong with that request. Please try again.