You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A project which requires two actions to be mapped to the same key, one with a modifier, and one without.
These actions are separated into different nodes, which independently listen for _input events.
Describe the problem or limitation you are having in your project
I have two events:
ui_a which maps to i (letter i) ui_b which maps to Alt+i (Alt + the letter i)
When attempting to listen for ui_b with event.is_action_pressed("ui_b") the node listening for ui_a takes precedence, and still matches, even though there's a modifier pressed.
Normally after ui_a action, I'll do get_tree().set_input_as_handled() to prevent further propagation of the event.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I would like to have the modifier key take part in understanding if that action is really pressed, because here it feels like a bug in some ways.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Perhaps just limit the actions with modifier keys, so that pressing the key with a modifier (Alt+i) will not call the (i) key event.
Perhaps default to calling the (i) event if there are no keys with modifier associated.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Unfortunately not so easily, I'd like to be able to configure these keys at runtime.
Is there a reason why this should be core and not an add-on in the asset library?
It's a problem of InputMap as far as I can see.
The text was updated successfully, but these errors were encountered:
I see that it's already been merged into master, is it planned for this be backported to 3.x?
Since the new input action system contains many breaking changes, I'm afraid it may not be possible. The pull request I linked is backwards-compatible, but it may rely on other changes that aren't.
Describe the project you are working on
A project which requires two actions to be mapped to the same key, one with a modifier, and one without.
These actions are separated into different nodes, which independently listen for
_input
events.Describe the problem or limitation you are having in your project
I have two events:
ui_a
which maps toi
(letter i)ui_b
which maps toAlt+i
(Alt + the letter i)When attempting to listen for
ui_b
withevent.is_action_pressed("ui_b")
the node listening forui_a
takes precedence, and still matches, even though there's a modifier pressed.Normally after
ui_a
action, I'll doget_tree().set_input_as_handled()
to prevent further propagation of the event.Describe the feature / enhancement and how it helps to overcome the problem or limitation
I would like to have the modifier key take part in understanding if that action is really pressed, because here it feels like a bug in some ways.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Perhaps just limit the actions with modifier keys, so that pressing the key with a modifier (Alt+i) will not call the (i) key event.
Perhaps default to calling the (i) event if there are no keys with modifier associated.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Unfortunately not so easily, I'd like to be able to configure these keys at runtime.
Is there a reason why this should be core and not an add-on in the asset library?
It's a problem of
InputMap
as far as I can see.The text was updated successfully, but these errors were encountered: