久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='i5ro9'><style id='i5ro9'><dir id='i5ro9'><q id='i5ro9'></q></dir></style></legend>
    <i id='i5ro9'><tr id='i5ro9'><dt id='i5ro9'><q id='i5ro9'><span id='i5ro9'><b id='i5ro9'><form id='i5ro9'><ins id='i5ro9'></ins><ul id='i5ro9'></ul><sub id='i5ro9'></sub></form><legend id='i5ro9'></legend><bdo id='i5ro9'><pre id='i5ro9'><center id='i5ro9'></center></pre></bdo></b><th id='i5ro9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='i5ro9'><tfoot id='i5ro9'></tfoot><dl id='i5ro9'><fieldset id='i5ro9'></fieldset></dl></div>

      <tfoot id='i5ro9'></tfoot>

        • <bdo id='i5ro9'></bdo><ul id='i5ro9'></ul>

        <small id='i5ro9'></small><noframes id='i5ro9'>

        將多個鍵綁定到 Keypress 事件

        Bind Multiple Keys to Keypress Event(將多個鍵綁定到 Keypress 事件)

            <tbody id='EWypS'></tbody>

            • <legend id='EWypS'><style id='EWypS'><dir id='EWypS'><q id='EWypS'></q></dir></style></legend>
            • <i id='EWypS'><tr id='EWypS'><dt id='EWypS'><q id='EWypS'><span id='EWypS'><b id='EWypS'><form id='EWypS'><ins id='EWypS'></ins><ul id='EWypS'></ul><sub id='EWypS'></sub></form><legend id='EWypS'></legend><bdo id='EWypS'><pre id='EWypS'><center id='EWypS'></center></pre></bdo></b><th id='EWypS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EWypS'><tfoot id='EWypS'></tfoot><dl id='EWypS'><fieldset id='EWypS'></fieldset></dl></div>

              <small id='EWypS'></small><noframes id='EWypS'>

              • <bdo id='EWypS'></bdo><ul id='EWypS'></ul>
                <tfoot id='EWypS'></tfoot>

                1. 本文介紹了將多個鍵綁定到 Keypress 事件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我目前正在使用這個 Javascript 按鍵代碼在按鍵時觸發事件:

                  I am currently using this Javascript keypress code to fire events upon keypress:

                  $(document).keydown(function(e) {
                      switch(e.keyCode) {
                  
                      case 39:
                          e.preventDefault();
                          alert("Arrow Key");
                          break;
                  
                      case 37:
                          e.preventDefault();
                          alert("Arrow Key");
                      }
                  });
                  

                  但我想知道的是,我是否可以綁定兩個鍵的組合而不是綁定一個鍵.我可以做類似的事情嗎:

                  but what I am wondering is if I can instead of binding one key bind a combination of two keys. Could I possibly do something like:

                  $(document).keydown(function(e) {
                      switch(e.keyCode) { 
                          case 39 && 37:
                              e.preventDefault();
                              alert("Arrow Key");
                          break;
                      }
                  });
                  

                  推薦答案

                  如果你想一次檢查多個鍵,你應該只使用一個常規鍵和一個或多個修飾鍵(alt/shift/ctrl),因為你不能確保在用戶的鍵盤上實際上可以同時按下兩個常規鍵(實際上,它們總是可以按下,但由于鍵盤的接線方式,PC 可能無法理解).

                  If you want to check multiple keys at once you should only use one regular key and one or more modifier keys (alt/shift/ctrl) as you cannot be sure that two regular keys can actually be pressed at once on the user's keyboard (actually, they can always be pressed but the PC might not understand it due to the way keyboards are wired).

                  您可以使用 e.altKey、e.ctrlKey、e.shiftKey 字段來檢查是否按下了匹配的修飾鍵.

                  You can use the e.altKey, e.ctrlKey, e.shiftKey fields to check if the matching modifier key was pressed.

                  例子:

                  $(document).keydown(function(e) {
                      if(e.which == 98 && e.ctrlKey) {
                          // ctrl+b pressed
                      }
                  });
                  

                  這篇關于將多個鍵綁定到 Keypress 事件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
                    <tbody id='rIpz7'></tbody>

                    <legend id='rIpz7'><style id='rIpz7'><dir id='rIpz7'><q id='rIpz7'></q></dir></style></legend>

                        <tfoot id='rIpz7'></tfoot>
                          <bdo id='rIpz7'></bdo><ul id='rIpz7'></ul>
                          1. <small id='rIpz7'></small><noframes id='rIpz7'>

                          2. <i id='rIpz7'><tr id='rIpz7'><dt id='rIpz7'><q id='rIpz7'><span id='rIpz7'><b id='rIpz7'><form id='rIpz7'><ins id='rIpz7'></ins><ul id='rIpz7'></ul><sub id='rIpz7'></sub></form><legend id='rIpz7'></legend><bdo id='rIpz7'><pre id='rIpz7'><center id='rIpz7'></center></pre></bdo></b><th id='rIpz7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rIpz7'><tfoot id='rIpz7'></tfoot><dl id='rIpz7'><fieldset id='rIpz7'></fieldset></dl></div>
                            主站蜘蛛池模板: 免费啪啪 | 亚洲精品久久久久久一区二区 | 欧美日韩综合精品 | 久久久精品久久 | 91精品久久久久久久 | 台湾佬久久 | 精品视频一区二区三区在线观看 | 欧美国产日韩精品 | 国产日韩精品在线 | 国产精品国产三级国产aⅴ原创 | 久久精品国产一区二区电影 | 成人精品啪啪欧美成 | 日韩中文字幕在线观看 | 日本一区二区在线视频 | 看av在线| 精品久久国产 | 91玖玖 | 91久久久久久久 | 成人av免费 | 午夜影院在线 | 日韩一二区 | 一区二区三区国产 | 四虎影视1304t | 伊人爽 | 欧美视频精品 | 国产精品成人免费 | 国产精品99久久久久久动医院 | 韩三级在线观看 | 在线观看中文字幕dvd播放 | 狠狠爱免费视频 | 国产91在线 | 欧美 | 精品欧美一区二区三区久久久 | 欧美日韩综合 | 国产欧美在线观看 | 日韩精品一区二区三区中文在线 | 久久久久www| 草久久 | 6080yy精品一区二区三区 | 亚洲欧洲精品一区 | 亚州毛片 | 99这里只有精品视频 |