Submitted On 06-JUL-2001
xolotl
I believe the example provided is bogus because it does
not use any window! If cp is some visible AWT component,
cp.getToolkit().getLockingKeyState() works fine for me
with JDK 1.3.1 under W2K.
Submitted On 12-JUL-2001
wmshub
I think this bug does not appear in Windows. In Linux, the
fix you give does not work.
Submitted On 29-MAY-2002
skywind8
I'm having a similar problem under Sun JDK 1.4.0 for Linux,
except for me it always returns true, instead of always
returning false. Go figure. I'll have to retest under
windows and see if that makes it go away.
Submitted On 14-JUL-2002
bregman
I had a similar problem with JDK 1.4.1 on Windows. I found
out that the state got updated only after pressing some
key. When I changed the CAPS lock state when the focus was
outside my Java application and then set the focus back, I
didn't get the state change. But, once I pressed some key I
got the correct state.
Submitted On 25-APR-2006
Alex_Matute
I implemented bregman's solution with a Robot and now it works
Submitted On 29-JAN-2007
This bug still exists in JDK 1.6. It seems like using the native GetKeyState() is a simple solution. Is Sun still planning to fix this?
I tried a Robot solution but it seemed unreliable. The generated key press/release events weren't always delivered, perhaps due to thread timing issues.
Submitted On 10-JUL-2007
samiam2642
I'm definitely having issues with this one. It seems to me more like it returns the state of the key when the application starts, and then continually returns the same value.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|