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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user