No Description

Matt Clark f39bd02d43 Updating pom for initial release. 4 weeks ago
src 12fb5eb87a Initial commit pf LibAPIs. 3 months ago
.gitignore 12fb5eb87a Initial commit pf LibAPIs. 3 months ago
README.md 12fb5eb87a Initial commit pf LibAPIs. 3 months ago
pom.xml f39bd02d43 Updating pom for initial release. 4 weeks ago

README.md

KeyHook

A Java/Native global keyboard hook.

Usage

Using the library is as simple as adding a Maven dependency and a few lines to handle the events.

Maven

<dependency>
    <groupId>com.mclarkdev.tools</groupId>
    <artifactId>libkeyhook</artifactId>
    <version>1.0</version>
</dependency>

Java

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);