function keyPressHandler(){
	this.keyArray = new Array();
	this.keyArray["shift"] = this.keyArray["alt"] = this.keyArray["ctrl"] = this.keyArray["key"] = "";
	this.chars1_32 = new Array("NULL", "SOH", "STX", "ETX", "EOT",
		"ENQ", "ACK", "BEL", "Backspace", "Horizontal Tab",
		"Line Feed", "Vertical Tab", "New Page", "Carriage Return",
		"Shift Out", "Shift In", "DLE", "DC1", "DC2", "DC3", "DC4",
		"NAK", "SNY", "ETB", "Cancel", "EM", "SUB", "Escape",
		"File Separator", "Group Separator", "Record Separator",
		"Unit Separator", "Space");

	this.hotKeys = new Array();

	this.waitForKeys = function(e){
		var shiftPressed	= false;
		var altPressed		= false;
		var ctrlPressed		= false;
		var unicode		= e.charCode ? e.charCode : e.keyCode;
		var evt			= navigator.appName == "Netscape" ? e : event;
		shiftPressed		= evt.shiftKey;
		altPressed		= evt.altKey;
		ctrlPressed		= evt.ctrlKey;
		var stringKey		= "";

		if(unicode <= 32){
			// Special char, read from the array
			stringKey = chars1_32[unicode];
		}else if(unicode == 127){
			// Delete button
			stringKey = "Delete";
		}else if(unicode >= 37 && unicode <= 40){
			// Arrows
			switch(unicode){
				case 37:
					stringKey = "Left";
					break;
				case 38:
					stringKey = "Up";
					break;
				case 39:
					stringKey = "Right";
					break;
				case 40:
					stringKey = "Down";
					break;
			}
		}else{
			// Catch-all, use the character
			stringKey = String.fromCharCode(unicode);
		}

		keyPressed = "";

		if(ctrlPressed){
			keyPressed += "1";
		}else{
			keyPressed += "0";
		}

		if(shiftPressed){
			keyPressed += "1";
		}else{
			keyPressed += "0";
		}

		if(altPressed){
			keyPressed += "1";
		}else{
			keyPressed += "0";
		}

		keyPressed += stringKey;

		if(typeof this.hotKeys[keyPressed] == "function"){
			this.hotKeys[keyPressed]();
		}
	};

	this.addHotKey = function(func, strHotKey){
		var strHotKeyCombo = "";

		if(arguments[2] !== 'undefined' && arguments[2] == true){
			strHotKeyCombo += "1";
		}else{
			strHotKeyCombo += "0";
		}

		if(arguments[3] !== 'undefined' && arguments[3] == true){
			strHotKeyCombo += "1";
		}else{
			strHotKeyCombo += "0";
		}

		if(arguments[4] !== 'undefined' && arguments[4] == true){
			strHotKeyCombo += "1";
		}else{
			strHotKeyCombo += "0";
		}

		strHotKeyCombo += strHotKey;

		this.hotKeys[strHotKeyCombo] = func;
	};
}
