Make InputEventMouseButton.as_text()
work similar to InputEventKey.as_text()
#2221
Labels
InputEventMouseButton.as_text()
work similar to InputEventKey.as_text()
#2221
Describe the project you are working on
Editor plugin with customizable input event map.
Describe the problem or limitation you are having in your project
I need to get recent mouse "shortcut" as text (like
Control+BUTTON_LEFT
,Control+Shift+BUTTON_RIGHT
).I've found
InputEventKey.as_text()
that works as I need (that is it returnsControl+D
,Shift+R
etc) and I expected this to work forInputEventMouseButton
the same way, but it doesn't.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Making
InputEventMouseButton.as_text()
work similar toInputEventKey
would solve the problemDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
returning modifiers+button_index like
Control+BUTTON_LEFT
,Control+Shift+BUTTON_RIGHT
would be fine.If this enhancement will not be used often, can it be worked around with a few lines of script?
As a workaround I think a function could be created like
I see 2 tasks here:
This could be done like:
and
2. getting modifiers as text, something like:
but I just ran into some challenges like:
event.command
is also true (Linux);not sure how to correctly solve this
Is there a reason why this should be core and not an add-on in the asset library?
I think this could be useful for implementing any customizable input event system that allows using "mouse shortcuts" with modifiers
The text was updated successfully, but these errors were encountered: