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>
|
||||
<groupId>lc.kra.system</groupId>
|
||||
<artifactId>system-hook</artifactId>
|
||||
<version>2.1</version>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -60,8 +60,14 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
||||
}
|
||||
}, "seekbar");
|
||||
seekBarUpdater.start();
|
||||
try {
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user