Steps to reproduce:
Join a world in the latest version or the latest snapshot and turn toggle sprint on.
Set the sprint key to any mouse button in the controls menu.
Press the key to enable toggle sprint.
Move around to confirm toggle sprint is enabled.
Open and close your inventory, the pause menu, or any container with a GUI.
Expected result:
After closing the GUI, your sprint remains toggled on as it would if the key bind was any keyboard key.
Actual result:
You are no longer sprinting and need to press the mouse button again to toggle it back on.
The same is true with sneaking as having the sneak key bound to any keyboard key restores your toggled sneak state after opening and closing a GUI whereas having it bound to any mouse button will not restore it.
Thank you for your report!
We're tracking this issue in MC-301281, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki