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

Dedicated keybind to activate flying? & hold/toggle option #55

Open
muzikbike opened this issue Sep 4, 2022 · 6 comments
Open

Dedicated keybind to activate flying? & hold/toggle option #55

muzikbike opened this issue Sep 4, 2022 · 6 comments

Comments

@muzikbike
Copy link

This request is related to #53. In #53, double-pressing the "move forward" key will cause the player to start sprinting, and that ticket raises the issue that this functionality cannot be unlinked from the move forward key and assigned to some other key.

Flying is a similar case - it is activated by double-pressing the key that causes the player to jump. The problem is that it too follows the jump key around, which is undesirable. It'd be expected that by default, the "jump" and "start flying" keys would both be bound to spacebar, and could be rebound to any desired key. Pressing the "start flying" key once, if the jump key isn't bound to the same key as it, would immediately cause the player to start flying.

And for consistency with sneaking and sprinting, there would be an option to change whether this key toggles flying when pressed, or if it should be held down continuously to remain in flying mode.

I would like a dedicated flying key a lot, since my computer lags a lot and sometimes it takes a lot of spacebar spamming to have the game register that I want to fly. The ability to split that key from the spacebar and only have to press it once to initiate fly mode would make things a lot easier.

@Klotzi111
Copy link

Klotzi111 commented Sep 5, 2022

You effectively request two different features. The Dedicated keybind to activate flying and hold/toggle option. So you better made two issues for them.

I agree with you. Both features would be nice.

The first (flying keybinding) with an simple implementation would be easy to make. But if we would add such a feature that differentiates between single pressing and double pressing we would add it generally as a "modifier". As already explained in #53 (comment) this is not easy.

The second feature (hold/toggle option) is also not so clear how to implement if seen for all possible keybindings and their actions. The sprint, sneak, fly and show inventory actions are easy/clear. But with actions like dropping it is difficult. What would toggling the drop-keybinding mean? Repeatedly dropping items? I do not know.
Another option would be to only enable the toggle or hold option for specific keybindings like those mentioned before. But how to check whether to enable this option for an keybinding?
We could hardcode the vanilla actions. But what about other mod keybindings?

  • Activating it via the amecs api? Possible but not good because many mods will not use the api.
  • Activating each individual keybindins via an options file? This would enable modpack makers and individuals to enable setting hold/toggle for all possible keybindings. But makes it less intuitive and less useful.

Please tell me your thoughts.

@muzikbike
Copy link
Author

I've singled out flying (that is, being in a flying state, as opposed to the control that makes you fly upwards) as something that should be hold/toggle switchable since it's a player movement state much like sneaking and sprinting are. I don't see much point in other controls like item dropping being made hold/toggle.

Should I go ahead and split the hold/toggle part of this request into its own ticket?

@Klotzi111
Copy link

Should I go ahead and split the hold/toggle part of this request into its own ticket?

No. Leave it for now.

I don't see much point in other controls like item dropping being made hold/toggle.

Me neither. But the question is still how to handle mod keybindings with hold/toggle?

Just for clarification. You want a new keybinding "Activate Flying" that can additionally be configured to either "Hold" or "Toggle".
If "Hold" is configured the keybinding will set you in a flying state as long as you hold the key.
If "Toggle" is configured the keybinding will toggle your flying state apon pressing the key.
Is this correct?

@muzikbike
Copy link
Author

muzikbike commented Sep 9, 2022

Is this correct?

Yes.

the question is still how to handle mod keybindings with hold/toggle?

I assume this is referring to mods that would introduce keybinds for other player movement states, such as a mod that adds a keybind for crawling?


Just noticed that I had actually suggested something like this for RandomPatches over a year ago, which obviously never got implemented as it appears the mod has been discontinued: TheRandomLabs/RandomPatches#237

@Klotzi111
Copy link

I will look into it and try some things. I will let you know when there is a version with this feature to try.

@muzikbike
Copy link
Author

@Klotzi111 It's been a while, is a build with this feature and/or secondary sprint available anywhere?

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