tyrano.plugin.kag.key_mouse={kag:null,init:function(){var that=this;var keysdown = {};$(document).keydown(function(e){if (keysdown[e.keyCode]) {return;} keysdown[e.keyCode]=true; if(e.ctrlKey){that.kag.stat.is_skip=true}});$(document).keyup(function(e){ delete keysdown[e.keyCode]; that.kag.stat.is_skip=false;switch(e.keyCode){case 13:case 32:if(that.kag.key_mouse.canClick())$(".layer_event_click").click();break;case 27:that.kag.key_mouse.hideMessage();break}});$(document).on("mousedown",function(e){if(e.which==3)if($(".button_menu").is(":visible"))that.kag.key_mouse.showMenu();else that.kag.key_mouse.hideMessage()});$(document).on("contextmenu",function(e){return false})},canClick:function(){if($(".layer_event_click").css("display")!=
"none")return true;return false},canShowMenu:function(){if($(".layer_free").css("display")=="none")return true;return false},showMenu:function(){if(this.canShowMenu())if($(".menu_close").size()>0&&$(".layer_menu").css("display")!="none")$(".menu_close").click();else $(".button_menu").click()},hideMessage:function(){if(this.canShowMenu())if($(".menu_close").size()>0&&$(".layer_menu").css("display")!="none")$(".menu_close").click();else if(!this.kag.stat.is_strong_stop)if(this.kag.stat.is_hide_message)this.kag.layer.showMessageLayers();
else this.kag.ftag.startTag("hidemessage")}};
