Program will now still run if global keyboard hooks fail to initialise.
This commit is contained in:
parent
7dc4019785
commit
ddd5934ae1
2
pom.xml
2
pom.xml
@ -88,7 +88,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>lc.kra.system</groupId>
|
<groupId>lc.kra.system</groupId>
|
||||||
<artifactId>system-hook</artifactId>
|
<artifactId>system-hook</artifactId>
|
||||||
<version>2.1</version>
|
<version>2.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -60,8 +60,14 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
|||||||
}
|
}
|
||||||
}, "seekbar");
|
}, "seekbar");
|
||||||
seekBarUpdater.start();
|
seekBarUpdater.start();
|
||||||
GlobalKeyboardHook keyboardHook = new GlobalKeyboardHook();
|
try {
|
||||||
keyboardHook.addKeyListener(new GlobalKeyboardShortcuts());
|
GlobalKeyboardHook keyboardHook = new GlobalKeyboardHook();
|
||||||
|
keyboardHook.addKeyListener(new GlobalKeyboardShortcuts());
|
||||||
|
} catch(RuntimeException ex){
|
||||||
|
System.out.println("Keyboard hook failed, global shortcuts will not work this session.");
|
||||||
|
System.out.println(ex.getMessage());
|
||||||
|
System.out.println(Arrays.toString(ex.getStackTrace()));
|
||||||
|
}
|
||||||
refreshLibrary();
|
refreshLibrary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user