mirror of https://github.com/mgba-emu/mgba.git
SDL: Clean up key handling, change rewind key to backtick
This commit is contained in:
parent
b9623efc0c
commit
c05b166469
|
@ -112,46 +112,43 @@ static void _GBASDLHandleKeypress(struct GBAThread* context, struct GBASDLEvents
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (event->keysym.sym) {
|
if (event->keysym.sym == SDLK_TAB) {
|
||||||
case SDLK_F11:
|
context->sync.audioWait = event->type != SDL_KEYDOWN;
|
||||||
if (event->type == SDL_KEYDOWN && context->debugger) {
|
|
||||||
ARMDebuggerEnter(context->debugger, DEBUGGER_ENTER_MANUAL);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
if (event->type == SDL_KEYDOWN) {
|
||||||
|
switch (event->keysym.sym) {
|
||||||
|
case SDLK_F11:
|
||||||
|
if (context->debugger) {
|
||||||
|
ARMDebuggerEnter(context->debugger, DEBUGGER_ENTER_MANUAL);
|
||||||
|
}
|
||||||
|
return;
|
||||||
#ifdef USE_PNG
|
#ifdef USE_PNG
|
||||||
case SDLK_F12:
|
case SDLK_F12:
|
||||||
if (event->type == SDL_KEYDOWN) {
|
|
||||||
GBAThreadInterrupt(context);
|
GBAThreadInterrupt(context);
|
||||||
GBAThreadTakeScreenshot(context);
|
GBAThreadTakeScreenshot(context);
|
||||||
GBAThreadContinue(context);
|
GBAThreadContinue(context);
|
||||||
}
|
return;
|
||||||
return;
|
|
||||||
#endif
|
#endif
|
||||||
case SDLK_TAB:
|
case SDLK_BACKSLASH:
|
||||||
context->sync.audioWait = event->type != SDL_KEYDOWN;
|
|
||||||
return;
|
|
||||||
case SDLK_BACKSLASH:
|
|
||||||
if (event->type == SDL_KEYDOWN) {
|
|
||||||
GBAThreadPause(context);
|
GBAThreadPause(context);
|
||||||
context->frameCallback = _pauseAfterFrame;
|
context->frameCallback = _pauseAfterFrame;
|
||||||
GBAThreadUnpause(context);
|
GBAThreadUnpause(context);
|
||||||
}
|
return;
|
||||||
return;
|
case SDLK_BACKQUOTE:
|
||||||
case SDLK_LEFTBRACKET:
|
GBAThreadInterrupt(context);
|
||||||
GBAThreadInterrupt(context);
|
GBARewind(context, 10);
|
||||||
GBARewind(context, 10);
|
GBAThreadContinue(context);
|
||||||
GBAThreadContinue(context);
|
return;
|
||||||
return;
|
case SDLK_ESCAPE:
|
||||||
case SDLK_ESCAPE:
|
GBAThreadInterrupt(context);
|
||||||
GBAThreadInterrupt(context);
|
if (context->gba->rr) {
|
||||||
if (context->gba->rr) {
|
GBARRStopPlaying(context->gba->rr);
|
||||||
GBARRStopPlaying(context->gba->rr);
|
GBARRStopRecording(context->gba->rr);
|
||||||
GBARRStopRecording(context->gba->rr);
|
}
|
||||||
}
|
GBAThreadContinue(context);
|
||||||
GBAThreadContinue(context);
|
return;
|
||||||
return;
|
default:
|
||||||
default:
|
|
||||||
if (event->type == SDL_KEYDOWN) {
|
|
||||||
if ((event->keysym.mod & GUI_MOD) && (event->keysym.mod & GUI_MOD) == event->keysym.mod) {
|
if ((event->keysym.mod & GUI_MOD) && (event->keysym.mod & GUI_MOD) == event->keysym.mod) {
|
||||||
switch (event->keysym.sym) {
|
switch (event->keysym.sym) {
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
|
@ -238,8 +235,8 @@ static void _GBASDLHandleKeypress(struct GBAThread* context, struct GBASDLEvents
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue