Program will now still run if global keyboard hooks fail to initialise.

This commit is contained in:
neviyn 2016-03-09 02:30:38 +00:00
parent 7dc4019785
commit 85e73e827f

View File

@ -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();
}