Commit 177385cb authored by hisuinohoshi's avatar hisuinohoshi

Add hotkey

新增:
- zzzzzzzzzzzzzz
parent d17f66e1
......@@ -15,7 +15,7 @@ $areaesc = 1;
$isduel = 0;
//开启快捷键?0为不开启,1为开启
$hotkeyon = 0;
$hotkeyon = 1;
//开启NPC台词功能?0为不开启,1为开启
$npcchaton = 1;
//有台词的NPC(已废弃,只要登记过台词的NPC就会显示台词,需要关闭哪个NPC的台词功能请直接注释掉ta的台词)
......
function hotkey(evt)
/*function hotkey(evt)
{
if(document.activeElement.tagName != 'INPUT'){
evt = (evt) ? evt : ((window.event) ? window.event : '');
......@@ -9,6 +9,68 @@ function hotkey(evt)
}
}
}
}*/
var ms;
hotkey_ok = true;
refchat_ok = true;
function hotkey(evt)
{
if(hotkey_ok && document.activeElement.tagName != 'INPUT'){
evt = (evt) ? evt : ((window.event) ? window.event : '');
var ky = evt.keyCode ? evt.keyCode : evt.which;
flag=1;//是否完成冷却
if (ms!=undefined) {
if (ms>0) flag=0;
}
//双字母id=冷却时间内不可执行的操作 单字母可以执行
if(!evt.ctrlKey && !evt.altKey && !evt.shiftKey){
if(ky==90){
flag==1 ? hotkey_click('zz') : hotkey_click('z');
}
else if(ky==65){
flag==1 ? hotkey_click('aa') : hotkey_click('a');
}
else if(ky==83){
flag==1 ? hotkey_click('ss') : hotkey_click('s');
}
else if(ky==68){
flag==1 ? hotkey_click('dd') : hotkey_click('d');
}
else if(ky==81){
flag==1 ? hotkey_click('qq') : hotkey_click('q');
}
else if(ky==87){
flag==1 ? hotkey_click('ww') : hotkey_click('w');
}
else if(ky==69){
flag==1 ? hotkey_click('ee') : hotkey_click('e');
}
else if(ky==88){
flag==1 ? hotkey_click('xx') : hotkey_click('x');
}
else if(ky==67){
flag==1 ? hotkey_click('cc') : hotkey_click('c');
}
else if(ky==86){
hotkey_click('v');
}
else if(ky >= 49 && ky <= 54){
var kc=(ky-48).toString();
flag==1 ? hotkey_click(kc+kc) : hotkey_click(kc);
}
}
}
}
function hotkey_click(hkid){
var hk = $(hkid);
if (hk) hk.click();
else if ((hkid == 'zz' || hkid == 'z' || hkid == 'x') && $('zx')) $('zx').click();
else if (hkid.length > 1) {
hk = $(hkid.substr(0,1));
if (hk) hk.click();
}
}
//update time
......
......@@ -8,18 +8,18 @@
<tr>
<!-- 第一攻击方式 -->
<td width=100px align="center" style="vertical-align:top">
<input type="button" class="cmdbutton" style="width:95" name="w1" value="{$attinfo[$w1]}" onclick="$('command').value='$w1';postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" style="width:95" id="zz" name="w1" value="[Z]{$attinfo[$w1]}" onclick="$('command').value='$w1';postCmd('gamecmd','command.php');this.disabled=true;">
</td>
<!-- 第二攻击方式 -->
<!--{if $w2}-->
<td width=100px>
<input type="button" class="cmdbutton" style="width:95" name="w2" value="{$attinfo[$w2]}" onclick="$('command').value='$w2';postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" style="width:95" id="aa" name="w2" value="[A]{$attinfo[$w2]}" onclick="$('command').value='$w2';postCmd('gamecmd','command.php');this.disabled=true;">
</td>
<!--{/if}-->
<td width=100px>
<!-- 切换副武器 -->
<!--{if $pdata['wep2s']}-->
<input type="button" class="cmdbutton" style="width:95" value="切换" onclick="$('command').value='changewep';postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" style="width:95" id="cc" value="[C]切换" onclick="$('command').value='changewep';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{/if}-->
</td>
</tr>
......@@ -42,7 +42,7 @@
<!-- 末行:逃跑、坚守 -->
<tr>
<td width=100px align="center" style="vertical-align:top">
<input type="button" class="cmdbutton" name="back" style="width:95" value="逃跑" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" id="x" name="back" style="width:95" value="[X]逃跑" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
</td>
<td>
</td>
......
<input type="hidden" name="mode" value="command">
<input type="hidden" name="command" value="back">
<input type="button" class="cmdbutton" name="submit" value="确定" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]确定" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
This diff is collapsed.
......@@ -55,4 +55,4 @@
<input type="radio" name="command" id="money" value="money" checked><a onclick=sl('money'); href="javascript:void(0);" >$w_money {lang moneyunit} </a><br>
<!--{/if}-->
<input type="button" name="submit" value="提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" id="zz" name="submit" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -11,4 +11,4 @@
(注意,deathnote只能对玩家使用。)
<br />
<br />
<input type="button" name="submit" value="提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" name="submit" id="zz" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -25,10 +25,10 @@
</table>
<br>
<!--{if $dkey > 0}-->
<input type="button" class="cmdbutton" style="margin-right: 5%;" value="上一页" onclick="changePages($dkey,$dkey-1);">
<input type="button" class="cmdbutton" id="c" style="margin-right: 5%;" value="[C]上一页" onclick="changePages($dkey,$dkey-1);">
<!--{/if}-->
<!--{if (($dkey < ($maxdkey-1)) || (isset($dialogue_branch[$dialogue_id])))}-->
<input type="button" class="cmdbutton" value="下一页" onclick="changePages($dkey,$dkey+1);">
<input type="button" class="cmdbutton" id="z" value="[Z]下一页" onclick="changePages($dkey,$dkey+1);">
<!--{elseif isset($dialogue_end[$dialogue_id])}-->
$dialogue_end[$dialogue_id]
<!--{/if}-->
......@@ -48,9 +48,9 @@
</center></p>
<!--{if (isset($dialogue_branch[$dialogue_id]) || isset($dialogue_end[$dialogue_id]))}-->
<img class="dialog-background" src="img/profile.gif" onclick="">
<img class="dialog-background" src="img/profile.gif" id="x" onclick="">
<!--{else}-->
<img class="dialog-background" src="img/profile.gif" onclick="closeDialog($('dialogue'));$('command').value='end_dialogue';postCmd('gamecmd','command.php');this.disabled=true;">
<img class="dialog-background" src="img/profile.gif" id="x" onclick="closeDialog($('dialogue'));$('command').value='end_dialogue';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{/if}-->
</dialog>
<script>
......
......@@ -64,5 +64,5 @@
&nbsp; › 当前:效果、耐久占比会在<span class="lime">2%~98%</span>间浮动。</span><br>
<br>
<!--{/if}-->
<input type="button" class="cmdbutton" name="submit" value="提交" onclick="$('command').value='elementmix';itemmixchooser();postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" name="submit" value="放弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="$('command').value='elementmix';itemmixchooser();postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" id="x" name="submit" value="[X]放弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" name="back" value="返回" onclick="postCmd('gamecmd','command.php');"><br><br>
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="back" value="[Z]返回" onclick="postCmd('gamecmd','command.php');"><br><br>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<input type="hidden" name="mode" value="senditem">
<input type="hidden" id="command" name="command" value="back">
留言:<br><input size="30" type="text" name="message" maxlength="60"><br><br>
<input type="button" class="cmdbutton" name="back" value="返回" onclick="postCmd('gamecmd','command.php');"><br><br>
<input type="button" class="cmdbutton" id="zz" name="back" value="[Z]返回" onclick="postCmd('gamecmd','command.php');"><br><br>
<!--{if $itms1}-->
转让:<input type="button" name="itm1" value="{$itm1}/{$itme1}/{$itms1}" onclick="$('command').value='itm1';postCmd('gamecmd','command.php');"><br>
<!--{/if}-->
......
......@@ -182,7 +182,7 @@
</style>
<!--{/if}-->
</head>
<BODY <!--{if CURSCRIPT == 'game' && $hotkeyon}-->onkeydown="hotkey(event);"<!--{/if}-->>
<BODY <!--{if CURSCRIPT == 'game' && $hotkeyon}-->onkeyup="hotkey(event);"<!--{/if}-->>
<div class="title" >{lang title}</div>
<div class="headerlink" >
<a href="index.php">>>{lang index}</a>
......
......@@ -20,4 +20,4 @@
<input type="radio" name="command" id="itm6" value="dropitm6"><a onclick=sl('itm6'); href="javascript:void(0);" >$itm6/$itme6/$itms6 </a><br>
<!--{/if}-->
<br><br>
<input type="button" class="cmdbutton" name="submit" value="确定并丢弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]确定并丢弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -8,4 +8,4 @@
<input type="radio" name="command" id="itm5" value="swapitm5"><a onclick=sl('itm5'); href="javascript:void(0);" >$itm5/$itme5/$itms5 </a><br>
<input type="radio" name="command" id="itm6" value="swapitm6"><a onclick=sl('itm6'); href="javascript:void(0);" >$itm6/$itme6/$itms6 </a><br>
<br><br>
<input type="button" class="cmdbutton" name="submit" value="确定" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]确定" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -10,5 +10,5 @@
<!--{if $itms5}--><input type="checkbox" id="mitm5" name="mitm5" value="0"><a onclick="$('mitm5').click();" href="javascript:void(0);">$itm5/$itme5/$itms5</a><br><!--{/if}-->
<!--{if $itms6}--><input type="checkbox" id="mitm6" name="mitm6" value="0"><a onclick="$('mitm6').click();" href="javascript:void(0);">$itm6/$itme6/$itms6</a><br><!--{/if}-->
<br>
<input type="button" class="cmdbutton" name="submit" value="提交" onclick="$('command').value='itemencase';itemmixchooser();postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" name="submit" value="放弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="$('command').value='itemencase';itemmixchooser();postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" id="x" name="submit" value="[X]放弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -5,9 +5,9 @@
<br>
<input type="hidden" id="mode" name="mode" value="itemmain">
<input type="hidden" id="command" name="command" value="itemget">
<input type="button" class="cmdbutton" name="itemget" value="拾取" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" id="zz" name="itemget" value="[Z]拾取" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
<!--{if $club==20}-->
&nbsp;&nbsp;<input type="button" class="cmdbutton" name="split_itm" value="提炼" onclick="$('command').value='split_itm0';postCmd('gamecmd','command.php');this.disabled=true;">
&nbsp;&nbsp;<input type="button" id="cc" class="cmdbutton" name="split_itm" value="[A]提炼" onclick="$('command').value='split_itm0';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{/if}-->
<br><br>
<input type="button" class="cmdbutton" name="dropitm0" value="丢弃" onclick="$('command').value='dropitm0';postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="xx" name="dropitm0" value="[X]丢弃" onclick="$('command').value='dropitm0';postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -59,4 +59,4 @@
<br>
<input type="button" class="cmdbutton" name="submit" value="提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -10,5 +10,5 @@
<!--{if $itms5}--><input type="checkbox" id="mitm5" name="mitm5" value="0"><a onclick="$('mitm5').click();" href="javascript:void(0);">$itm5/$itme5/$itms5</a><br><!--{/if}-->
<!--{if $itms6}--><input type="checkbox" id="mitm6" name="mitm6" value="0"><a onclick="$('mitm6').click();" href="javascript:void(0);">$itm6/$itme6/$itms6</a><br><!--{/if}-->
<br>
<input type="button" class="cmdbutton" name="submit" value="提交" onclick="$('command').value='itemmix';itemmixchooser();postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" name="submit" value="放弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="$('command').value='itemmix';itemmixchooser();postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" id="x" name="submit" value="[X]放弃" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -42,4 +42,4 @@
<!--{/if}-->
<br><br>
<input type="text" name="rename" value=""><br>
<input type="button" class="cmdbutton" name="submit" value="改名" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]改名" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="hidden" name="mode" value="command">
<input type="hidden" name="command" value="menu">
<input type="button" class="cmdbutton" name="submit" value="返回" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]返回" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
$restinfo[$state] 中。。。<br>
<input type="hidden" id="mode" name="mode" value="rest">
<input type="hidden" id="command" name="command" value="rest">
<input type="button" class="cmdbutton" name="rest" value="$restinfo[$state]" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" name="back" value="返回" onclick="$('command').value='back';postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="rest" value="[Z]{$restinfo[$state]}" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
<input type="button" class="cmdbutton" id="x" name="back" value="[X]返回" onclick="$('command').value='back';postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -14,4 +14,4 @@
<input type="hidden" name="buynum" value="1">
<!--{/if}-->
<br><br>
<input type="button" class="cmdbutton" name="submit" value="提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -20,4 +20,4 @@
<input type="radio" name="command" id="shop16" value="shop16"><a onclick=sl('shop16'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround3.gif) repeat-x">【NPC解锁钥匙】</font></a><br>
<input type="radio" name="command" id="shop18" value="shop18"><a onclick=sl('shop18'); href="javascript:void(0);" onmouseover="status=' ';return true;"><font style="background:url(img/backround9.gif) repeat-x">【上级者向物品】</font></a><br>
<br><br>
<input type="button" class="cmdbutton" name="submit" value="提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
......@@ -4,4 +4,4 @@
<div>15个字以内。<div>
<div>队伍密码 : <input size="15" type="text" name="nteamPass" maxlength="30"></div>
<div>15个字以内。<div>
<input type="button" class="cmdbutton" name="submit" value="提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<input type="button" class="cmdbutton" id="zz" name="submit" value="[Z]提交" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment