diff --git a/src/devices/keyboard-joypad/KeyboardJoypad.cpp b/src/devices/keyboard-joypad/KeyboardJoypad.cpp index 3d71cda..ab0f128 100644 --- a/src/devices/keyboard-joypad/KeyboardJoypad.cpp +++ b/src/devices/keyboard-joypad/KeyboardJoypad.cpp @@ -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; }