Skip to content

Commit

Permalink
count correctly all buttons even if not mapped
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Adenis-Lamarre <[email protected]>
  • Loading branch information
nadenislamarre committed Jun 28, 2023
1 parent dc56fdf commit 84f6cf4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/api/udev/JoystickUdev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,7 @@ bool CJoystickUdev::GetProperties()
// Go through all possible keycodes, check if they are used, and map them to
// button/axes/hat indices
unsigned int buttons = 0;
for (unsigned int i = KEY_UP; i <= KEY_DOWN; i++)
{
if (test_bit(i, keybit))
m_button_bind[i] = buttons++;
}
for (unsigned int i = BTN_MISC; i < KEY_MAX; i++)
for (unsigned int i = 0; i < KEY_MAX; i++)
{
if (test_bit(i, keybit))
m_button_bind[i] = buttons++;
Expand Down

0 comments on commit 84f6cf4

Please sign in to comment.