<bdo id='wQ3XB'></bdo><ul id='wQ3XB'></ul>

      <legend id='wQ3XB'><style id='wQ3XB'><dir id='wQ3XB'><q id='wQ3XB'></q></dir></style></legend>
      <tfoot id='wQ3XB'></tfoot>

      <i id='wQ3XB'><tr id='wQ3XB'><dt id='wQ3XB'><q id='wQ3XB'><span id='wQ3XB'><b id='wQ3XB'><form id='wQ3XB'><ins id='wQ3XB'></ins><ul id='wQ3XB'></ul><sub id='wQ3XB'></sub></form><legend id='wQ3XB'></legend><bdo id='wQ3XB'><pre id='wQ3XB'><center id='wQ3XB'></center></pre></bdo></b><th id='wQ3XB'></th></span></q></dt></tr></i><div id='wQ3XB'><tfoot id='wQ3XB'></tfoot><dl id='wQ3XB'><fieldset id='wQ3XB'></fieldset></dl></div>
      1. <small id='wQ3XB'></small><noframes id='wQ3XB'>

        如何判断按下了哪个 SHIFT 键?

        时间:2023-09-26
        <legend id='JLLMW'><style id='JLLMW'><dir id='JLLMW'><q id='JLLMW'></q></dir></style></legend>
      2. <tfoot id='JLLMW'></tfoot>
            <bdo id='JLLMW'></bdo><ul id='JLLMW'></ul>

            • <i id='JLLMW'><tr id='JLLMW'><dt id='JLLMW'><q id='JLLMW'><span id='JLLMW'><b id='JLLMW'><form id='JLLMW'><ins id='JLLMW'></ins><ul id='JLLMW'></ul><sub id='JLLMW'></sub></form><legend id='JLLMW'></legend><bdo id='JLLMW'><pre id='JLLMW'><center id='JLLMW'></center></pre></bdo></b><th id='JLLMW'></th></span></q></dt></tr></i><div id='JLLMW'><tfoot id='JLLMW'></tfoot><dl id='JLLMW'><fieldset id='JLLMW'></fieldset></dl></div>

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

                    <tbody id='JLLMW'></tbody>

                  本文介绍了如何判断按下了哪个 SHIFT 键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  在我的游戏中,我希望能够使用左右 shift 键来执行不同的功能.在 Java(或其他语言)中,有什么方法可以区分这两者吗?

                  In my game, I want to be able to use the right and left shift keys for different functions. In Java (or another language), is there any way to distinguish between those two?

                  KeyEvent类只有VK_SHIFT,对应左右shift键.与 ControlAltEnter 等相同.

                  The KeyEvent class has only VK_SHIFT, which corresponds to both left and right shift keys. Same with Control, Alt, Enter, etc.

                  我主要担心有人可能会用两根手指同时快速按下两个键,从而获得不公平的优势.我应该担心这个吗?

                  My primary concern is someone may be able to use two fingers to rapidly press both keys at the same time, gaining an unfair advantage. Should I be concerned about this?

                  推荐答案

                  我找到了一个包含 Java WebStart 示例和源代码的 Java 教程.看起来获胜者是 KeyEvent.getKeyLocation()

                  I found a Java tutorial that includes a Java WebStart sample and the source code. Looks like the winner is KeyEvent.getKeyLocation()

                  • KeyEvent.KEY_LOCATION_STANDARD
                  • KeyEvent.KEY_LOCATION_LEFT
                  • KeyEvent.KEY_LOCATION_RIGHT
                  • KeyEvent.KEY_LOCATION_NUMPAD
                  • KeyEvent.KEY_LOCATION_UNKNOWN

                  参考资料:

                  关键监听器演示和源代码

                  这篇关于如何判断按下了哪个 SHIFT 键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Android - 激活系统键锁(又名锁屏) 下一篇:控制台应用程序中的 Java 键盘输入解析

                  相关文章

                  最新文章

                        <bdo id='ikL0S'></bdo><ul id='ikL0S'></ul>
                      <legend id='ikL0S'><style id='ikL0S'><dir id='ikL0S'><q id='ikL0S'></q></dir></style></legend>

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

                    1. <i id='ikL0S'><tr id='ikL0S'><dt id='ikL0S'><q id='ikL0S'><span id='ikL0S'><b id='ikL0S'><form id='ikL0S'><ins id='ikL0S'></ins><ul id='ikL0S'></ul><sub id='ikL0S'></sub></form><legend id='ikL0S'></legend><bdo id='ikL0S'><pre id='ikL0S'><center id='ikL0S'></center></pre></bdo></b><th id='ikL0S'></th></span></q></dt></tr></i><div id='ikL0S'><tfoot id='ikL0S'></tfoot><dl id='ikL0S'><fieldset id='ikL0S'></fieldset></dl></div>
                      <tfoot id='ikL0S'></tfoot>