|
2 weeks ago | |
---|---|---|
src | 2 weeks ago | |
.gitignore | 2 years ago | |
README.md | 2 weeks ago | |
pom.xml | 2 weeks ago |
A minimal, Java based, global key press listener.
Include the library in your project by adding the following dependency to your pom.xml
<dependency>
<groupId>com.mclarkdev.tools</groupId>
<artifactId>libkeyhook</artifactId>
<version>1.5.1</version>
</dependency>
Create an EventListener to handle the keyboard events.
private EventListener eventListener = new EventListener() {
@Override
public void onEvent(ArrayList<Integer> keyMap) {
String keys = keyMap.stream().map(Object::toString)//
.collect(Collectors.joining(", "));
System.out.println("Keys:" + keys);
}
};
Attach the listener to the LibKeyhookManager.
LibKeyhookManager.getInstance().attachListener(eventListener);
Open source & free for all. ❤