How to check if cap-lock is enabled or missing in java

Possible duplicate:
How to determine if droplet lock is switched to Swing?

How to determine (method to know) whether caplock is enabled or not in a java application because I want to see the user when the user enters a password in my application.

+6
source share
4 answers
boolean state= Toolkit.getDefaultToolkit() .getLockingKeyState(KeyEvent.VK_CAPS_LOCK); 
+2
source
 boolean capsIsOn = Toolkit.getDefaultToolkit(). getLockingKeyState(KeyEvent.VK_CAPS_LOCK); 
+3
source

Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);

Related: How can I get the state of Caps Lock and enable it if it has not been?

Use Google before asking, please;)

+2
source
 boolean isCapsLock = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); 
+1
source

Source: https://habr.com/ru/post/919576/


All Articles