Keyboard hook fixes, added targetRefresh command

Keyboard hook class now only listens for Hot Keys and not a all keys in
a global keyboard hook.  This should fix the reliability of the keyboard
hook.
Added a new command targetRefresh which will allow you to refresh the
XML on a specified window and not the entire desktop.  This will help if
you want to speed up the synthuse script by not continuously doing full
refreshes of the xml.
This commit is contained in:
Edward Jakubowski
2014-05-16 08:00:24 -04:00
parent 33522694e4
commit c36aa19753
7 changed files with 193 additions and 35 deletions

View File

@@ -393,7 +393,7 @@ public class SynthuseDlg extends JFrame {
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
KeyboardHook.stopGlobalKeyboardHook(); //stop keyboard hook
KeyboardHook.stopKeyboardHook(); //stop keyboard hook
config.save();
SynthuseDlg.this.dispose(); // force app to close
}
@@ -402,7 +402,7 @@ public class SynthuseDlg extends JFrame {
KeyboardHook.addKeyEvent(config.getRefreshKeyCode(), true, true, false);// refresh xml when CTRL+SHIFT+3 is pressed
KeyboardHook.addKeyEvent(config.getTargetKeyCode(), true, true, false);// target window when CTRL+SHIFT+~ is pressed
//add global hook and event
KeyboardHook.StartGlobalKeyboardHookThreaded(new KeyboardHook.KeyboardEvents() {
KeyboardHook.StartKeyboardHookThreaded(new KeyboardHook.KeyboardEvents() {
@Override
public void keyPressed(KeyboardHook.TargetKeyPress target) {
//System.out.println("target key pressed " + target.targetKeyCode);