user5051664
user5051664

Reputation:

Caps Lock Detection not working

When detecting a CAPS LOCK in Processing Java, I encountered this error:

Cannot find anything named "KeyEvent.VK_CAPS_LOCK"

I'm pretty sure I can run Java methods in Processing. The following code below is my import and the variableI set. I think I have everything I need in the import because I imported everything from Java's AWT.

import java.awt.*;
boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); 

Upvotes: 2

Views: 259

Answers (1)

Codebender
Codebender

Reputation: 14471

KeyEvent is not part of java.awt package. It's part of java.awt.event package. So you will need to include that package as well.

Upvotes: 1

Related Questions