(function(){u8.Base.HotKey=function(e){if(e&&typeof e=="object"){$.extend(this,e);this.bind(e)}this.ctrlKey=false;this.altKey=false;this.shiftKey=false;this.keyCode=-1;if(typeof e=="string"){this.parse(e)}};u8.Base.HotKey.makeClass({name:"HotKey",events:["Hit"]});$.extend(u8.Base.HotKey.prototype,{dispose:function(){this.unbind()},parse:function(e){if(!e){return}var t=e.split("+");if(!t||t.length<=0){return}if(t.length>1){for(var s=0;s<t.length-1;s++){this._parseModifier(t[s])}}this._parseKeyCode(t.peek())},isValid:function(){return this.keyCode>0},getDisplayString:function(){var e="";if(this.altKey){e+=(u8.session.commonTexts.hotkeyAlt||"Alt")+"+"}if(this.ctrlKey){e+=(u8.session.commonTexts.hotkeyCtrl||"Ctrl")+"+"}if(this.shiftKey){e+=(u8.session.commonTexts.hotkeyShift||"Shift")+"+"}if(this.keyCode>=112&&this.keyCode<=123){e+="F"+(this.keyCode-111).toString()}else{e+=String.fromCharCode(this.keyCode)}return e},_parseKeyCode:function(e){if(!e){return}if(e.length>1){e=e.toLowerCase();if(e.charAt(0)=="#"){this.keyCode=parseInt(e.substr(1))}else if(e.charAt(0)=="f"){this.keyCode=parseInt(e.substr(1))+111}else if(e=="blank"){this.keyCode=32}else if(e=="del"){this.keyCode=46}else if(e=="esc"){this.keyCode=27}else if(e=="tab"){this.keyCode=9}}else{this.keyCode=e.charCodeAt(0)}},_parseModifier:function(e){if(!e){return false}e=e.toLowerCase();if("shift"==e){this.shiftKey=true}else if("ctrl"==e){this.ctrlKey=true}else if("alt"==e){this.altKey=true}else{return false}return true}})})();