Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split the "double-press to sprint" functionality from the forward key #53

Open
muzikbike opened this issue Sep 3, 2022 · 2 comments
Open

Comments

@muzikbike
Copy link

Currently, the functionality that causes the player to start sprinting when the forward button is pressed is always bound to the forward key. This is vanilla bug https://bugs.mojang.com/browse/MC-203401.

RandomPatches fixed this by adding a secondary sprint key, which shares the forward key by default but could be decoupled from it. It functioned identically to the sprint button in this case, and I believe it also fixed some other bugs along the way such as the inability to sprint while flying by double tapping.
2022-09-03_15 30 11

Since RandomPatches no longer seems to be receiving updates, could this functionality be added to this mod? It seems like the most fitting place for it.

This could also allow for another key modifier type to be implemented: pressing a key twice in quick succession (perhaps the time interval could be configurable as well?) could give a different outcome than a single press.

@muzikbike
Copy link
Author

Since this key is by definition a duplicate of the sprint key, I considered having it be part of No More Useless Keybinds instead, but since it's a part of vanilla as well I'm not sure if deleting it could wreak havoc.

@Klotzi111
Copy link

Since RandomPatches no longer seems to be receiving updates, could this functionality be added to this mod? It seems like the most fitting place for it.

Yes amecs would be a fitting mod for this. I will have a look at that.

This could also allow for another key modifier type to be implemented: pressing a key twice in quick succession (perhaps the time interval could be configurable as well?) could give a different outcome than a single press.

This is a good idea but sadly can not be implemented in a way people would want to use.
Because when pressing the button for the first time we (amecs) can not know that this key will be pressed again shortly. So the action for the normal key press will be triggered. Then when the second press comes we can additionally do the action for the configured double press but we can not undo the action from the single press before.
Alternatively we could wait (and not trigger the action) after receiving the first button press for the configured double press time. And when we get an second press in time we could do the configured action. And if the wait time exceeds we do the single press action. But this would mean we have delayed single press actions. Nobody wants that.
Maybe you have another idea how this could be implemented.

Since this key is by definition a duplicate of the sprint key, I considered having it be part of No More Useless Keybinds instead, but since it's a part of vanilla as well I'm not sure if deleting it could wreak havoc.

NMUK is not really fitting because the single press action (walk forward) and double press action (enable sprint) are different. NMUK only allows to add multiple keys to one action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants