Skip to content

Commit

Permalink
bug: ignore num lock for keys
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jun 26, 2023
1 parent e7091d6 commit d0bf625
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sdl_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ bool sdlk_eq(const SDL_Keysym &a, const SDL_Keysym &b)

//
// So either shift key works
//
if (k1.mod & KMOD_SHIFT)
k1.mod |= KMOD_SHIFT;
if (k2.mod & KMOD_SHIFT)
Expand All @@ -1090,6 +1091,13 @@ bool sdlk_eq(const SDL_Keysym &a, const SDL_Keysym &b)
if (k2.mod & KMOD_CTRL)
k2.mod |= KMOD_CTRL;

//
// The chromebook duet reports all keys as num lock on. I'm not sure
// if I should generally ignore this or now.
//
k1.mod &= ~KMOD_NUM;
k2.mod &= ~KMOD_NUM;

return (k1.sym == k2.sym) && (k1.mod == k2.mod);
}

Expand Down

0 comments on commit d0bf625

Please sign in to comment.