Skip to content
Snippets Groups Projects
Commit 07002bf8 authored by Dallin Nickel (djn011)'s avatar Dallin Nickel (djn011)
Browse files

Moved the keylistener to its own seperate class

parent 0f262d77
No related branches found
No related tags found
2 merge requests!65Prototype,!52Feature addmacros
package Controller;
import model.OSInterface;
import org.jnativehook.keyboard.NativeKeyEvent;
import org.jnativehook.keyboard.NativeKeyListener;
import static Controller.KeyConversion.map;
import static ui.MainScreen.dict;
public class KeyListener implements NativeKeyListener {
public KeyListener(){}
@Override
public void nativeKeyPressed(NativeKeyEvent nativeKeyEvent) {
try{
OSInterface.getInstance().sendKey(dict.get(map.get(nativeKeyEvent.getKeyCode())), true);
} catch(Exception e) {
System.out.println(map.get(nativeKeyEvent.getKeyCode()));
}
}
@Override
public void nativeKeyReleased(NativeKeyEvent nativeKeyEvent) {
}
@Override
public void nativeKeyTyped(NativeKeyEvent nativeKeyEvent) {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment