<AWT Dev> Workaround for bug JDK-8167263: "[macos] Java keyPressed function of Key Listener doesn't work for W, A, S, D"
Sergey.Bylokhov at oracle.com
Thu Dec 14 19:23:22 UTC 2017
Thank you for this workaround, I have added a comment to the bug.
On 07/12/2017 02:03, Gareth Randall wrote:
> I have a workaround for bug JDK-8167263: "[macos] Java keyPressed
> function of Key Listener doesn't work for W, A, S, D"
> However, I do not have rights to post on the discussion for this bug so
> perhaps someone could post this message to the thread?
> The thread is at: https://bugs.openjdk.java.net/browse/JDK-8167263
> The problem of missing events is related the macOS feature which offers
> the character accent menu when a key is held down, instead of
> I experienced the same problem described in the bug but with a different
> set of keys. (In my case Z, X, : and .) When I disabled the character
> accent menu the problem disappeared and key events auto-repeated as
> To disabled the character accent menu and enable auto-repeat, type the
> following at the command prompt:
> defaults write -g ApplePressAndHoldEnabled -bool false
> This can be reversed with the following:
> defaults write -g ApplePressAndHoldEnabled -bool true
> Hopefully this will provide a pointer for your team to work out how to
> do this programmatically, but until then the workaround can help
> interested users.
Best regards, Sergey.
More information about the awt-dev