Skip to content

Commit

Permalink
Merge pull request GLVis#300 from GLVis/numlock-fix
Browse files Browse the repository at this point in the history
Fix an issue when `numlock` is on
  • Loading branch information
tzanio authored Jul 26, 2024
2 parents 53353c1 + 73c4e9e commit ae4abfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void SdlWindow::keyDownEvent(SDL_Keysym& ks)
// to be processed there.
// Note: the same condition has to be used in signalKeyDown().
if ((ks.sym >= 32 && ks.sym < 127) &&
(ks.mod & ~(KMOD_SHIFT | KMOD_CAPS)) == 0)
(ks.mod & (KMOD_CTRL | KMOD_ALT | KMOD_GUI)) == 0)
{
lastKeyDownProcessed = false;
return;
Expand Down Expand Up @@ -630,7 +630,7 @@ void SdlWindow::signalKeyDown(SDL_Keycode k, SDL_Keymod m)
queueEvents({ event });

// The same condition as in keyDownEvent().
if ((k >= 32 && k < 127) && (m & ~(KMOD_SHIFT | KMOD_CAPS)) == 0)
if ((k >= 32 && k < 127) && (m & (KMOD_CTRL | KMOD_ALT | KMOD_GUI)) == 0)
{
event.type = SDL_TEXTINPUT;
event.text.windowID = window_id;
Expand Down

0 comments on commit ae4abfe

Please sign in to comment.