How do I check if the caps lock key is pressed?

前端 未结 3 1801
终归单人心
终归单人心 2020-12-07 01:24

Alright, before this gets flagged as a possible duplicate, I\'ve already tried the following code:

Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK         


        
3条回答
  •  天涯浪人
    2020-12-07 02:02

    Poking around, I think getLockingKeyState() might be broken.

    You could try KeyboardUtils, but it looks like that means you have to carry JNA overhead.

提交回复
热议问题