Skip to content

Commit b59488a

Browse files
committed
Remove keyboard handlers for now, SDL text input interferes with Dear ImGui.
1 parent 254560e commit b59488a

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

src/RenderLoop.cpp

+19-13
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ void RenderLoop::Run()
2828
while (!_wantsToQuit)
2929
{
3030
limiter.StartFrame();
31+
3132
PollEvents();
3233
CheckViewportSize();
3334
_audioCapture.FillBuffer();
3435
_projectMWrapper.RenderFrame();
3536
_presetSelectionGui.Draw();
37+
3638
_sdlRenderingWindow.Swap();
39+
3740
limiter.EndFrame();
3841
}
3942

@@ -51,7 +54,12 @@ void RenderLoop::PollEvents()
5154
switch (event.type)
5255
{
5356
case SDL_MOUSEWHEEL:
54-
ScrollEvent(event.wheel);
57+
58+
if (!_presetSelectionGui.WantsMouseInput())
59+
{
60+
ScrollEvent(event.wheel);
61+
}
62+
5563
break;
5664

5765
case SDL_KEYDOWN:
@@ -63,11 +71,19 @@ void RenderLoop::PollEvents()
6371
break;
6472

6573
case SDL_MOUSEBUTTONDOWN:
66-
MouseDownEvent(event.button);
74+
if (!_presetSelectionGui.WantsMouseInput())
75+
{
76+
MouseDownEvent(event.button);
77+
}
78+
6779
break;
6880

6981
case SDL_MOUSEBUTTONUP:
70-
MouseUpEvent(event.button);
82+
if (!_presetSelectionGui.WantsMouseInput())
83+
{
84+
MouseUpEvent(event.button);
85+
}
86+
7187
break;
7288

7389
case SDL_QUIT:
@@ -229,11 +245,6 @@ void RenderLoop::KeyEvent(const SDL_KeyboardEvent& event, bool down)
229245

230246
void RenderLoop::ScrollEvent(const SDL_MouseWheelEvent& event)
231247
{
232-
if (_presetSelectionGui.WantsMouseInput())
233-
{
234-
return;
235-
}
236-
237248
// Wheel up is positive
238249
if (event.y > 0)
239250
{
@@ -293,11 +304,6 @@ void RenderLoop::MouseDownEvent(const SDL_MouseButtonEvent& event)
293304

294305
void RenderLoop::MouseUpEvent(const SDL_MouseButtonEvent& event)
295306
{
296-
if (_presetSelectionGui.WantsMouseInput())
297-
{
298-
return;
299-
}
300-
301307
if (event.button == SDL_BUTTON_LEFT)
302308
{
303309
_mouseDown = false;

0 commit comments

Comments
 (0)