Skip to content

Commit 17c4b0e

Browse files
committed
add keyCode and buttonCode constants
1 parent b86712c commit 17c4b0e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

jquery.simulate.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,40 @@ $.simulate = function( elem, type, options ) {
3333
}
3434
};
3535

36+
$.extend( $.simulate, {
37+
38+
keyCode: {
39+
BACKSPACE: 8,
40+
COMMA: 188,
41+
DELETE: 46,
42+
DOWN: 40,
43+
END: 35,
44+
ENTER: 13,
45+
ESCAPE: 27,
46+
HOME: 36,
47+
LEFT: 37,
48+
NUMPAD_ADD: 107,
49+
NUMPAD_DECIMAL: 110,
50+
NUMPAD_DIVIDE: 111,
51+
NUMPAD_ENTER: 108,
52+
NUMPAD_MULTIPLY: 106,
53+
NUMPAD_SUBTRACT: 109,
54+
PAGE_DOWN: 34,
55+
PAGE_UP: 33,
56+
PERIOD: 190,
57+
RIGHT: 39,
58+
SPACE: 32,
59+
TAB: 9,
60+
UP: 38
61+
},
62+
63+
buttonCode: {
64+
LEFT: 0,
65+
MIDDLE: 1,
66+
RIGHT: 2
67+
}
68+
});
69+
3670
$.extend( $.simulate.prototype, {
3771

3872
simulateEvent: function( elem, type, options ) {

0 commit comments

Comments
 (0)