Frontend: Extract keyboard handling to seperate function
This commit is contained in:
parent
3db77a3139
commit
87f9f99938
|
@ -307,6 +307,17 @@ bool SDLInterface::HandleSDLEvent(const SDL_Event* event)
|
|||
|
||||
case SDL_KEYDOWN:
|
||||
case SDL_KEYUP:
|
||||
return HandleSDLKeyEvent(event);
|
||||
|
||||
case SDL_QUIT:
|
||||
m_running = false;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SDLInterface::HandleSDLKeyEvent(const SDL_Event* event)
|
||||
{
|
||||
const bool pressed = (event->type == SDL_KEYDOWN);
|
||||
switch (event->key.keysym.scancode)
|
||||
|
@ -396,13 +407,6 @@ bool SDLInterface::HandleSDLEvent(const SDL_Event* event)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SDL_QUIT:
|
||||
m_running = false;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ private:
|
|||
void DoSaveState(u32 index);
|
||||
|
||||
bool HandleSDLEvent(const SDL_Event* event);
|
||||
bool HandleSDLKeyEvent(const SDL_Event* event);
|
||||
bool PassEventToImGui(const SDL_Event* event);
|
||||
void Render();
|
||||
void RenderDisplay();
|
||||
|
|
Loading…
Reference in New Issue