-
Notifications
You must be signed in to change notification settings - Fork 11
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
Multiple Actions with the same KeyCode #45
Comments
Hey @nic96, eg, // utility to get bindings from Iron file, you can also create this object by code
let new_binding = Kurinji::get_bindings_from_ron("xyz.ron");
kurinji.push(new_binding); // push it to stack
....
kurinji.pop(); // to return to previous state |
No, that's not really what I'm looking for. In my case it's actually desired that both actions would be active at the same time or at least it wouldn't matter. I guess what would need to be done is bind and action to a key instead of a key to an action. If that makes any sense, but anyway if this is not something you intend to support that's fine. |
Could you share an example? I would like to know in which scenario it might be useful. |
Let's say you have a two guns on a vehicle. I'd want to allow either individual keys to fire the guns or a single key to fire both at once. Depending on a user's preference. Godot allows it and has multiple actions by default that have the same keys bound to it. It's also useful for UI, I mean bevy doesn't have much for UI at the moment, but one use case is using Space for both ui_select and also use Space key ui_accept. |
I'm currently using my own simple input map implementation and in it I'm using multimap. This allows for both multiple actions with a single key binding and multiple key bindings for a single action. I'm using the bitflags crate for action states so I can do a union across all the action states of the various keys. |
Currently it's not possible to have multiple actions use the same KeyCode. Would this be possible to implement?
The text was updated successfully, but these errors were encountered: