Switched to char based key identification.
This commit is contained in:
parent
7692ade2e5
commit
d3ff04bf99
@ -295,10 +295,10 @@ public class PlayerGUI extends JPanel implements PlayerCallbackInterface {
|
|||||||
|
|
||||||
private class GlobalKeyboardShortcuts implements NativeKeyListener {
|
private class GlobalKeyboardShortcuts implements NativeKeyListener {
|
||||||
boolean modified = false;
|
boolean modified = false;
|
||||||
final int playPause = NativeKeyEvent.VC_QUOTE;
|
final char playPause = '\'';
|
||||||
final int stop = NativeKeyEvent.VC_BACK_SLASH;
|
final char stop = '#';
|
||||||
final int previous = NativeKeyEvent.VC_OPEN_BRACKET;
|
final char previous = '[';
|
||||||
final int next = NativeKeyEvent.VC_CLOSE_BRACKET;
|
final char next = ']';
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void nativeKeyPressed(NativeKeyEvent nativeKeyEvent) {
|
public void nativeKeyPressed(NativeKeyEvent nativeKeyEvent) {
|
||||||
@ -316,7 +316,7 @@ public class PlayerGUI extends JPanel implements PlayerCallbackInterface {
|
|||||||
public void nativeKeyTyped(NativeKeyEvent nativeKeyEvent) {
|
public void nativeKeyTyped(NativeKeyEvent nativeKeyEvent) {
|
||||||
if (modified) {
|
if (modified) {
|
||||||
try {
|
try {
|
||||||
switch (nativeKeyEvent.getRawCode()) {
|
switch (nativeKeyEvent.getKeyChar()) {
|
||||||
case playPause:
|
case playPause:
|
||||||
if (player.isPlaying()) {
|
if (player.isPlaying()) {
|
||||||
player.pause();
|
player.pause();
|
||||||
|
Loading…
Reference in New Issue
Block a user