Program will now still run if global keyboard hooks fail to initialise.
This commit is contained in:
parent
7dc4019785
commit
85e73e827f
@ -60,8 +60,14 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
|||||||
}
|
}
|
||||||
}, "seekbar");
|
}, "seekbar");
|
||||||
seekBarUpdater.start();
|
seekBarUpdater.start();
|
||||||
|
try {
|
||||||
GlobalKeyboardHook keyboardHook = new GlobalKeyboardHook();
|
GlobalKeyboardHook keyboardHook = new GlobalKeyboardHook();
|
||||||
keyboardHook.addKeyListener(new GlobalKeyboardShortcuts());
|
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