diff --git a/src/main/java/musicplayer/PlayerGUI.java b/src/main/java/musicplayer/PlayerGUI.java index 6ec0160..4d51bbe 100644 --- a/src/main/java/musicplayer/PlayerGUI.java +++ b/src/main/java/musicplayer/PlayerGUI.java @@ -60,8 +60,14 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf } }, "seekbar"); seekBarUpdater.start(); - GlobalKeyboardHook keyboardHook = new GlobalKeyboardHook(); - keyboardHook.addKeyListener(new GlobalKeyboardShortcuts()); + 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(); }