On mac, in Java, keyPressed event doesn't fire for certain keys

后端 未结 4 1808
南旧
南旧 2021-01-14 19:01

This is a really weird issue, but I just have a simple keyListener added to a JPanel that prints on keyPressed and on keyReleased. Usually it works fine, but on certain keys

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 19:57

    It appears that this is a Java bug that arose after people upgraded to MacOS Sierra:

    • Java Bug Database

    • Reddit post

    As a temporary workaround you might try using keys other than the standard WASD for controlling movement.

提交回复
热议问题