Skip to content

Commit

Permalink
Merge pull request #275 from nadenislamarre/readallbuttons
Browse files Browse the repository at this point in the history
count correctly all buttons even if not mapped
  • Loading branch information
garbear authored May 27, 2024
2 parents c6c20b0 + 84f6cf4 commit ea825e8
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 ea825e8

Please sign in to comment.