mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 05:45:38 +00:00
SDL: Re-add frame step hotkey
Needs porting to Qt at some point.
This commit is contained in:
parent
1c50a09c2e
commit
93031fc27f
|
@ -351,6 +351,8 @@ bool SDLHostInterface::Initialize()
|
|||
return false;
|
||||
}
|
||||
|
||||
RegisterHotkeys();
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
||||
// process events to pick up controllers before updating input map
|
||||
|
@ -1334,6 +1336,16 @@ void SDLHostInterface::ClearImGuiFocus()
|
|||
ImGui::SetWindowFocus(nullptr);
|
||||
}
|
||||
|
||||
void SDLHostInterface::RegisterHotkeys()
|
||||
{
|
||||
RegisterHotkey(StaticString("General"), StaticString("FrameStep"), StaticString("Frame Step"), [this](bool pressed) {
|
||||
if (!pressed)
|
||||
{
|
||||
DoFrameStep();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void SDLHostInterface::DoStartDisc()
|
||||
{
|
||||
Assert(!m_system);
|
||||
|
|
|
@ -72,6 +72,7 @@ private:
|
|||
void DestroyDisplay();
|
||||
void CreateImGuiContext();
|
||||
void UpdateFramebufferScale();
|
||||
void RegisterHotkeys();
|
||||
|
||||
/// Executes a callback later, after the UI has finished rendering. Needed to boot while rendering ImGui.
|
||||
void RunLater(std::function<void()> callback);
|
||||
|
|
Loading…
Reference in a new issue