Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method to check whether caps-lock is on or not in java [duplicate]

Possible Duplicate:
How can I detect if caps lock is toggled in Swing?

How to detect ( method to know ) whether the capslock is on or not in java application because I wants to see to user when user enter password in my application.

like image 239
krupal Avatar asked Jul 03 '12 11:07

krupal


2 Answers

  boolean state= Toolkit.getDefaultToolkit()
                        .getLockingKeyState(KeyEvent.VK_CAPS_LOCK);  
like image 106
Nikson Kanti Paul Avatar answered Nov 09 '22 11:11

Nikson Kanti Paul


boolean capsIsOn = Toolkit.getDefaultToolkit().
                  getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
like image 21
Hemant Metalia Avatar answered Nov 09 '22 11:11

Hemant Metalia