The 3Dconnexion SpaceMouse Pro has 15 buttons. It generates messages with button IDs ranging from 0 to 26. However, the buttons array of the Joy message is statically resized to 2, which leads to memory corruption when setting button IDs larger than 1 in line 148.
The easiest fix is to always resize the button array to 27, but maybe there is a more elegant way to determine the actual type or button count of the connected device.
The 3Dconnexion SpaceMouse Pro has 15 buttons. It generates messages with button IDs ranging from 0 to 26. However, the
buttons
array of theJoy
message is statically resized to 2, which leads to memory corruption when setting button IDs larger than 1 in line 148.The easiest fix is to always resize the button array to 27, but maybe there is a more elegant way to determine the actual type or button count of the connected device.