Java - GetLockingState() won't update
问题 Found bug Java Bug "CAPS" doesn't update. I want it to be actively checking the locking state but it only checks it once and stores true/false in "CAPS" but if you hit caps lock it doesn't change the boolean stored in CAPS. Thread capsCheck = new Thread(() -> { while (true) { boolean CAPS = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); if (CAPS) { System.out.println("Caps enabled"); } else { System.out.println("Caps disabled"); } try { Thread.sleep(2000); } catch