Mouse button controls are stored as a signed integer instead of an unsigned short
The bug
When handling control bindings, Minecraft uses a signed integer for mouse buttons, which conflicts with the official USB Human Interface Devices documentation for input buttons, in which only 0x0000 to 0xFFFF (0 to 65535) are defined: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
As a result, it is possible for Minecraft to store and display controls which are assigned to mouse buttons 65536 and above, all the way to 2147483647. It can also display controls bound to negative mouse buttons (-1 to -2147483648), which do not exist either.
How to reproduce
- Have a control bound to a mouse button below 0 or above 65535. (This would normally be impossible as per MC-266231, however before 17w43a attempting to bind a control to mouse button 6 would result in it instead being bound to mouse button 10, and the game can be updated to 1.19 and then repeatedly closed and reopened in 1.19 to increase this value due to
MC-254355, which should eventually result in it exceeding 65535. Alternatively, just edit options.txt.) - Reload the game and then check the Key Binds menu
Expected results
Whatever control was bound to the illegal mouse button should be set to "Not Bound". This is what happens normally when an illegal key binding is encountered.
Actual results
The game interprets these illegal mouse buttons as completely valid.
How to fix
Instead of handling mouse buttons using a signed integer, an unsigned short should be used instead, as it perfectly contains all valid mouse button input values.
Further notes
It should be noted that "Button 0" is also a reserved control, so even though it's an acceptable value for an unsigned short, it may be advisable for Minecraft to consider it invalid as with the aforementioned extreme cases.
Created Issue:
Mouse button controls are stored as a signed integer instead of an unsigned short
The bug
When handling control bindings, Minecraft uses a signed integer for mouse buttons, which conflicts with the official USB Human Interface Devices documentation for input buttons, in which only 0x0000 to 0xFFFF (0 to 65535) are defined: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
As a result, it is possible for Minecraft to store and display controls which are assigned to mouse buttons 65536 and above, all the way to 2147483647. It can also display controls bound to negative mouse buttons (-1 to -2147483648), which do not exist either.
How to reproduce
- Have a control bound to a mouse button below 0 or above 65535. (This would normally be impossible as per MC-266231, however before 17w43a attempting to bind a control to mouse button 6 would result in it instead being bound to mouse button 10, and the game can be updated to 1.19 and then repeatedly closed and reopened in 1.19 to increase this value due to
MC-254355, which should eventually result in it exceeding 65535. Alternatively, just edit options.txt.)- Reload the game and then check the Key Binds menu
Expected results
Whatever control was bound to the illegal mouse button should be set to "Not Bound". This is what happens normally when an illegal key binding is encountered.
Actual results
The game interprets these illegal mouse buttons as completely valid.
How to fix
Instead of handling mouse buttons using a signed integer, an unsigned short should be sued instead, as it perfectly contains all valid mouse button input values.
The bug
When handling control bindings, Minecraft uses a signed integer for mouse buttons, which conflicts with the official USB Human Interface Devices documentation for input buttons, in which only 0x0000 to 0xFFFF (0 to 65535) are defined: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
As a result, it is possible for Minecraft to store and display controls which are assigned to mouse buttons 65536 and above, all the way to 2147483647. It can also display controls bound to negative mouse buttons (-1 to -2147483648), which do not exist either.
How to reproduce
- Have a control bound to a mouse button below 0 or above 65535. (This would normally be impossible as per MC-266231, however before 17w43a attempting to bind a control to mouse button 6 would result in it instead being bound to mouse button 10, and the game can be updated to 1.19 and then repeatedly closed and reopened in 1.19 to increase this value due to
MC-254355, which should eventually result in it exceeding 65535. Alternatively, just edit options.txt.)- Reload the game and then check the Key Binds menu
Expected results
Whatever control was bound to the illegal mouse button should be set to "Not Bound". This is what happens normally when an illegal key binding is encountered.
Actual results
The game interprets these illegal mouse buttons as completely valid.
How to fix
Instead of handling mouse buttons using a signed integer, an unsigned short should be sued instead, as it perfectly contains all valid mouse button input values.
Further notes
It should be noted that "Button 0" is also a reserved control, so even though it's an acceptable value for an unsigned short, it may be advisable for Minecraft to consider it invalid as with the aforementioned extreme cases.
The bug
When handling control bindings, Minecraft uses a signed integer for mouse buttons, which conflicts with the official USB Human Interface Devices documentation for input buttons, in which only 0x0000 to 0xFFFF (0 to 65535) are defined: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
As a result, it is possible for Minecraft to store and display controls which are assigned to mouse buttons 65536 and above, all the way to 2147483647. It can also display controls bound to negative mouse buttons (-1 to -2147483648), which do not exist either.
How to reproduce
- Have a control bound to a mouse button below 0 or above 65535. (This would normally be impossible as per MC-266231, however before 17w43a attempting to bind a control to mouse button 6 would result in it instead being bound to mouse button 10, and the game can be updated to 1.19 and then repeatedly closed and reopened in 1.19 to increase this value due to
MC-254355, which should eventually result in it exceeding 65535. Alternatively, just edit options.txt.)- Reload the game and then check the Key Binds menu
Expected results
Whatever control was bound to the illegal mouse button should be set to "Not Bound". This is what happens normally when an illegal key binding is encountered.
Actual results
The game interprets these illegal mouse buttons as completely valid.
How to fix
Instead of handling mouse buttons using a signed integer, an unsigned short should be
sued instead, as it perfectly contains all valid mouse button input values.Further notes
It should be noted that "Button 0" is also a reserved control, so even though it's an acceptable value for an unsigned short, it may be advisable for Minecraft to consider it invalid as with the aforementioned extreme cases.
The bug
When handling control bindings, Minecraft uses a signed integer for mouse buttons, which conflicts with the official USB Human Interface Devices documentation for input buttons, in which only 0x0000 to 0xFFFF (0 to 65535) are defined: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
As a result, it is possible for Minecraft to store and display controls which are assigned to mouse buttons 65536 and above, all the way to 2147483647. It can also display controls bound to negative mouse buttons (-1 to -2147483648), which do not exist either.
How to reproduce
- Have a control bound to a mouse button below 0 or above 65535. (This would normally be impossible as per MC-266231, however before 17w43a attempting to bind a control to mouse button 6 would result in it instead being bound to mouse button 10, and the game can be updated to 1.19 and then repeatedly closed and reopened in 1.19 to increase this value due to
MC-254355, which should eventually result in it exceeding 65535. Alternatively, just edit options.txt.)- Reload the game and then check the Key Binds menu
Expected results
Whatever control was bound to the illegal mouse button should be set to "Not Bound". This is what happens normally when an illegal key binding is encountered.
Actual results
The game interprets these illegal mouse buttons as completely valid.
How to fix
Instead of handling mouse buttons using a signed integer, an unsigned short should be used instead, as it perfectly contains all valid mouse button input values.
Further notes
It should be noted that "Button 0" is also a reserved control, so even though it's an acceptable value for an unsigned short, it may be advisable for Minecraft to consider it invalid as with the aforementioned extreme cases.


Thank you for your report!
After consideration, the issue is being closed as Invalid.
This report does not describe a bug.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki