function onKeyPress(e) {
				e = e || window.event;

				// Dont't enable shortcut keys in Input, Textarea fields
				if (protectInput === true) {
					var ele = e.target || e.srcElement;

					if (ele.nodeType === 3) {
						ele = ele.parentNode;
					}

					if ((ele.tagName === 'INPUT') || (ele.tagName === 'TEXTAREA')) {
						return;
					}
				}

				// Find Witch key is pressed
				var code = e.keyCode || e.witch;

				var chara = String.fromCharCode(code).toLowerCase();

				if (code === 188) chara = ',';
				if (code === 190) chara = '.';

				var keys = combination.split('+');

				// counts the number of valid keypresses
				var pressed = 0;

				var shiftNums = {
					"`" : "~",
					"1" : "!",
					"2" : "@",
					"3" : "#",
					"4" : "$",
					"5" : "%",
					"6" : "^",
					"7" : "&",
					"8" : "*",
					"9" : "(",
					"0" : ")",
					"-" : "_",
					"=" : "+",
					";" : ":",
					"'" : "\"",
					"," : "<",
					"." : ">",
					"/" : "?",
					"\\": "|"
				};

				var specialKeys = {
					'esc'      : 27,
					'escape'   : 27,
					'tab'      : 9,
					'space'    : 32,
					'return'   : 13,
					'enter'    : 13,
					'backspace': 8,

					'scrolllock' : 145,
					'scroll_lock': 145,
					'scroll'     : 145,
					'capslock'   : 20,
					'caps_lock'  : 20,
					'caps'       : 20,
					'numlock'    : 144,
					'num_lock'   : 144,
					'num'        : 144,

					'pause': 19,
					'break': 19,

					'insert': 45,
					'home'  : 36,
					'delete': 46,
					'end'   : 35,

					'pageup' : 33,
					'page_up': 33,
					'pu'     : 33,

					'pagedown' : 34,
					'page_down': 34,
					'pd'       : 34,

					'left' : 37,
					'up'   : 38,
					'right': 39,
					'down' : 40,

					'f1' : 112,
					'f2' : 113,
					'f3' : 114,
					'f4' : 115,
					'f5' : 116,
					'f6' : 117,
					'f7' : 118,
					'f8' : 119,
					'f9' : 120,
					'f10': 121,
					'f11': 122,
					'f12': 123
				};

				var modifiers = {
					shift: { wanted:false, pressed:false},
					ctrl : { wanted:false, pressed:false},
					alt  : { wanted:false, pressed:false},
					meta : { wanted:false, pressed:false}//Meta is Mac specific
				};

				if (e.ctrlKey)  modifiers.ctrl.pressed  = true;
				if (e.shiftKey) modifiers.shift.pressed = true;
				if (e.altKey)   modifiers.alt.pressed   = true;
				if (e.metaKey)  modifiers.meta.pressed  = true;

				for (var i = 0; i < keys.length; i++) {
					var k = keys[i];

					// Modifiers
					if (k === 'ctrl' || k === 'control') {
						pressed++;
						modifiers.ctrl.wanted = true;
					} else if (k === 'shift') {
						pressed++;
						modifiers.shift.wanted = true;
					} else if (k === 'alt') {
						pressed++;
						modifiers.alt.wanted = true;
					} else if (k === 'meta') {
						pressed++;
						modifiers.meta.wanted = true;
					} else if (k.length > 1) {
						// If it is a special key
						if (specialKeys[k] === code) {
							pressed++;
						}
					} else if (keycode !== null) {
						if (keycode === code) {
							pressed++;
						}
					} else {
						// The special keys did not match
						if (chara === k) {
							pressed++;
						} else {
							if(shiftNums[chara] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
								chara = shiftNums[chara];
								if (chara === k) {
									pressed++;
								}
							}
						}
					}
				}//<--for

				var isValid = (
					pressed                 === keys.length &&
					modifiers.ctrl.pressed  === modifiers.ctrl.wanted &&
					modifiers.shift.pressed === modifiers.shift.wanted &&
					modifiers.alt.pressed   === modifiers.alt.wanted &&
					modifiers.meta.pressed  === modifiers.meta.wanted
				);
				if (isValid) {
					callback(e);

					// Stop the event
					if (opt.propagate === false) {
						// e.cancelBubble is supported by IE - this will kill the bubbling process.
						e.cancelBubble = true;
						e.returnValue = false;

						//e.stopPropagation works in Firefox.
						if (e.stopPropagation) {
							e.stopPropagation();
							e.preventDefault();
						}
						return false;
					}
				}
			}//<--onKeyPress()

// The function to be called at keypress

The function to be called at keypress
The function to be called at keypress
function onKeyPress(e) {
				e = e || window.event;
				if (protectInput === true) {
					var ele = e.target || e.srcElement;
					if (ele.nodeType === 3) {
						ele = ele.parentNode;
					}
					if ((ele.tagName === 'INPUT') || (ele.tagName === 'TEXTAREA')) {
						return;
					}
				}
				var code = e.keyCode || e.witch;
				var chara = String.fromCharCode(code).toLowerCase();
				if (code === 188) chara = ',';
				if (code === 190) chara = '.';
				var keys = combination.split('+');
				var pressed = 0;
				var shiftNums = {
					"`" : "~",
					"1" : "!",
					"2" : "@",
					"3" : "#",
					"4" : "$",
					"5" : "%",
					"6" : "^",
					"7" : "&",
					"8" : "*",
					"9" : "(",
					"0" : ")",
					"-" : "_",
					"=" : "+",
					";" : ":",
					"'" : "\"",
					"," : "<",
					"." : ">",
					"/" : "?",
					"\\": "|"
				};
				var specialKeys = {
					'esc'      : 27,
					'escape'   : 27,
					'tab'      : 9,
					'space'    : 32,
					'return'   : 13,
					'enter'    : 13,
					'backspace': 8,
					'scrolllock' : 145,
					'scroll_lock': 145,
					'scroll'     : 145,
					'capslock'   : 20,
					'caps_lock'  : 20,
					'caps'       : 20,
					'numlock'    : 144,
					'num_lock'   : 144,
					'num'        : 144,
					'pause': 19,
					'break': 19,
					'insert': 45,
					'home'  : 36,
					'delete': 46,
					'end'   : 35,
					'pageup' : 33,
					'page_up': 33,
					'pu'     : 33,
					'pagedown' : 34,
					'page_down': 34,
					'pd'       : 34,
					'left' : 37,
					'up'   : 38,
					'right': 39,
					'down' : 40,
					'f1' : 112,
					'f2' : 113,
					'f3' : 114,
					'f4' : 115,
					'f5' : 116,
					'f6' : 117,
					'f7' : 118,
					'f8' : 119,
					'f9' : 120,
					'f10': 121,
					'f11': 122,
					'f12': 123
				};
				var modifiers = {
					shift: { wanted:false, pressed:false},
					ctrl : { wanted:false, pressed:false},
					alt  : { wanted:false, pressed:false},
					meta : { wanted:false, pressed:false}
				};
				if (e.ctrlKey)  modifiers.ctrl.pressed  = true;
				if (e.shiftKey) modifiers.shift.pressed = true;
				if (e.altKey)   modifiers.alt.pressed   = true;
				if (e.metaKey)  modifiers.meta.pressed  = true;
				for (var i = 0; i < keys.length; i++) {
					var k = keys[i];
					if (k === 'ctrl' || k === 'control') {
						pressed++;
						modifiers.ctrl.wanted = true;
					} else if (k === 'shift') {
						pressed++;
						modifiers.shift.wanted = true;
					} else if (k === 'alt') {
						pressed++;
						modifiers.alt.wanted = true;
					} else if (k === 'meta') {
						pressed++;
						modifiers.meta.wanted = true;
					} else if (k.length > 1) {
						if (specialKeys[k] === code) {
							pressed++;
						}
					} else if (keycode !== null) {
						if (keycode === code) {
							pressed++;
						}
					} else {
						if (chara === k) {
							pressed++;
						} else {
							if(shiftNums[chara] && e.shiftKey) { 
								chara = shiftNums[chara];
								if (chara === k) {
									pressed++;
								}
							}
						}
					}
				}
				var isValid = (
					pressed                 === keys.length &&
					modifiers.ctrl.pressed  === modifiers.ctrl.wanted &&
					modifiers.shift.pressed === modifiers.shift.wanted &&
					modifiers.alt.pressed   === modifiers.alt.wanted &&
					modifiers.meta.pressed  === modifiers.meta.wanted
				);
				if (isValid) {
					callback(e);
					if (opt.propagate === false) {
						e.cancelBubble = true;
						e.returnValue = false;
						if (e.stopPropagation) {
							e.stopPropagation();
							e.preventDefault();
						}
						return false;
					}
				}
			}
function onKeyPress ( e ) { e = e || window . event ; if ( protectInput === true ) { var ele = e . target || e . srcElement ; if ( ele . nodeType === 3 ) { ele = ele . parentNode ; } if ( ( ele . tagName === 'INPUT' ) || ( ele . tagName === 'TEXTAREA' ) ) { return ; } } var code = e . keyCode || e . witch ; var chara = String . fromCharCode ( code ) . toLowerCase ( ) ; if ( code === 188 ) chara = ',' ; if ( code === 190 ) chara = '.' ; var keys = combination . split ( '+' ) ; var pressed = 0 ; var shiftNums = { "`" : "~" , "1" : "!" , "2" : "@" , "3" : "#" , "4" : "$" , "5" : "%" , "6" : "^" , "7" : "&" , "8" : "*" , "9" : "(" , "0" : ")" , "-" : "_" , "=" : "+" , ";" : ":" , "'" : "\"" , "," : "<" , "." : ">" , "/" : "?" , "\\" : "|" } ; var specialKeys = { 'esc' : 27 , 'escape' : 27 , 'tab' : 9 , 'space' : 32 , 'return' : 13 , 'enter' : 13 , 'backspace' : 8 , 'scrolllock' : 145 , 'scroll_lock' : 145 , 'scroll' : 145 , 'capslock' : 20 , 'caps_lock' : 20 , 'caps' : 20 , 'numlock' : 144 , 'num_lock' : 144 , 'num' : 144 , 'pause' : 19 , 'break' : 19 , 'insert' : 45 , 'home' : 36 , 'delete' : 46 , 'end' : 35 , 'pageup' : 33 , 'page_up' : 33 , 'pu' : 33 , 'pagedown' : 34 , 'page_down' : 34 , 'pd' : 34 , 'left' : 37 , 'up' : 38 , 'right' : 39 , 'down' : 40 , 'f1' : 112 , 'f2' : 113 , 'f3' : 114 , 'f4' : 115 , 'f5' : 116 , 'f6' : 117 , 'f7' : 118 , 'f8' : 119 , 'f9' : 120 , 'f10' : 121 , 'f11' : 122 , 'f12' : 123 } ; var modifiers = { shift : { wanted : false , pressed : false } , ctrl : { wanted : false , pressed : false } , alt : { wanted : false , pressed : false } , meta : { wanted : false , pressed : false } } ; if ( e . ctrlKey ) modifiers . ctrl . pressed = true ; if ( e . shiftKey ) modifiers . shift . pressed = true ; if ( e . altKey ) modifiers . alt . pressed = true ; if ( e . metaKey ) modifiers . meta . pressed = true ; for ( var i = 0 ; i < keys . length ; i ++ ) { var k = keys [ i ] ; if ( k === 'ctrl' || k === 'control' ) { pressed ++ ; modifiers . ctrl . wanted = true ; } else if ( k === 'shift' ) { pressed ++ ; modifiers . shift . wanted = true ; } else if ( k === 'alt' ) { pressed ++ ; modifiers . alt . wanted = true ; } else if ( k === 'meta' ) { pressed ++ ; modifiers . meta . wanted = true ; } else if ( k . length > 1 ) { if ( specialKeys [ k ] === code ) { pressed ++ ; } } else if ( keycode !== null ) { if ( keycode === code ) { pressed ++ ; } } else { if ( chara === k ) { pressed ++ ; } else { if ( shiftNums [ chara ] && e . shiftKey ) { chara = shiftNums [ chara ] ; if ( chara === k ) { pressed ++ ; } } } } } var isValid = ( pressed === keys . length && modifiers . ctrl . pressed === modifiers . ctrl . wanted && modifiers . shift . pressed === modifiers . shift . wanted && modifiers . alt . pressed === modifiers . alt . wanted && modifiers . meta . pressed === modifiers . meta . wanted ) ; if ( isValid ) { callback ( e ) ; if ( opt . propagate === false ) { e . cancelBubble = true ; e . returnValue = false ; if ( e . stopPropagation ) { e . stopPropagation ( ) ; e . preventDefault ( ) ; } return false ; } } }
The function to be called at keypress
The function to be called at keypress
// Dont't enable shortcut keys in Input, Textarea fields
 // Find Witch key is pressed
 // counts the number of valid keypresses
 //Meta is Mac specific
 // Modifiers
 // If it is a special key
 // The special keys did not match
 //Stupid Shift key bug created by using lowercase
 //<--for
 // Stop the event
 // e.cancelBubble is supported by IE - this will kill the bubbling process.
 //e.stopPropagation works in Firefox.
 //<--onKeyPress()
