Skip to content

Commit

Permalink
Added check that the button is not duplicated in the same row
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Mar 30, 2024
1 parent 35f538e commit 9c22a2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/devices/keyboard-joypad/KeyboardJoypad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,11 @@ class yarp::dev::KeyboardJoypad::Impl
col = 0;
}
newButton.col = col++;
if (buttons.first.back().find(alias) != buttons.first.back().end())
{
yCError(KEYBOARDJOYPAD) << "The alias" << alias << "is already present in the buttons list in the same row.";
return false;
}
buttons.first.back()[alias] = newButton;

}
Expand Down

0 comments on commit 9c22a2c

Please sign in to comment.