久久久久久久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 | 亚洲综合热| 99reav| 91精品国产91久久久久久最新 | 日韩中文一区 | 免费一级片 | 日韩影院一区 | 91网站视频在线观看 | 玖玖视频国产 | 国产一区二区在线免费播放 | 免费日韩av网站 | 亚洲精品第一国产综合野 | 免费观看黄色一级片 | 午夜在线影院 | 国产精品美女久久久久久免费 | 久久久青草婷婷精品综合日韩 | 九九伊人sl水蜜桃色推荐 | 精品国产一区二区在线 | 国产精品一区二区欧美 | 在线视频国产一区 | 91视频在线看 | 欧美一级欧美三级在线观看 | 国产伦精品一区二区三区四区视频 | 国产成人综合在线 | 永久免费在线观看 | 亚洲精品国产精品国自产在线 | 久久草在线视频 | 国精久久| 欧美高清视频 | 亚洲电影一区 | 3级毛片| 国产精品一区二区三区在线 | 午夜视频在线观看一区二区 | 亚洲精品视频一区 | 午夜免费在线电影 | yiren22综合网成人 | 黄页网址在线观看 | 日韩精品成人 | 欧美日高清视频 | 综合久久99|