-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
modifier+key action shows also key action as pressed #18793
Comments
How would you solve that? Go though Input action list and ignore other actions if there is 'direct match'? |
If such a check is possible, that would probably solve it. Someone one irc suggested to add a flag for these cases. If that behavior I described is intended you would have to activate the flag for the specific actions. |
That's probably the best way. Many times you don't want a modifier key to shadow an action without modifier, e.g. pressing Space to jump should work even if you are holding Shift to run. |
Yeah thats true. If that is only possible with a flag thats fine too. |
That's assuming Shift+Space replaces jump. If the action is used for something on UI, for instance, then this automatic detection will be a bad thing. I believe there are use cases for both, so it should be a flag per-action. |
If an InputMap is going to abstract the keys for me, then it should do the work of filtering and fire exclusively based on most specific matching. My code should not know or care whether ui_focus_next or ui_focus_prev has more or less specific keys, whether they use modifiers or duplicate keys, or what order they should be in, as that defeats the whole purpose of the InputMap and abstracting the keys for me. ex.
ex2.
|
When pressing Alt + Left, the item list already handled the event and moved the selection to the left, unless the first item was selected. Because of this, moving up the history didn't work consistently. By using the gui_input signal to override the event handling, we can catch these events and handle them before the item list gets its fingers on them. Also gui_input should be emitted in viewport.cpp before _gui_input is called(Like explained in line 1516). Related to godotengine#18793 Might be a better way to do godotengine#22198
I just ran into this, and was about to file a bug. Z: Play C4 Note on piano But Ctrl+Z Plays the note AND performs undo. Filtering it myself would be a lot of work prone to bugs, since there's no central "UI Control" script and each part of the UI is a sub-scene and manages itself, not aware about where the conflicts may happen in other scenes. Allowing the Input system to perform this filtering as it's being suggested would be much, much welcome. Maybe an "Exclusive" checkbox column in the Input Map editor would cover most of the cases, and stay simple enough? Checking it would only fire the action if that key, and only that key, is pressed. Thanks! |
Reproducible in Godot 4.1 Sample project: https://drive.google.com/file/d/176GERr0Lba_PfpjPdpepBfQg24ZYtmJK/view?usp=sharing Pressing ctrl+A in the project triggers the action for a standalone A press |
When using the new optional argument for e.g. |
Godot Master
https://godotengine.org/qa/28199/how-to-use-shortcuts-with-modifier
I am looking for something like this I thought godot checks this internally. Try to press CONTROL+S.
Expected result CONTROL_S
This works but I can't use it in my case
The text was updated successfully, but these errors were encountered: