-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Buttons don't react to "ui_accept" via a mouse button and the cursor not over the control. #64176
Comments
@michael-nischt Can you reproduce this in any of the 3.5 betas and RCs to determine when the regression started? |
sure, In Based on the RC6 change-log I figured that is related:
And indeed, if i call at the start calling However, I believe it's still a bug since it's not only a problem with the generated action but also just adding LMB to "ui_accept" in the project settings. |
> Note: The issue required as to revert back the godot version since we hide the cursor and use mouse clicks as "ui_accept" in addition to game-pad inputs.
Out of curiosity, why are you disallowing mouse cursor input in menus? I feel this shouldn't be done for accessibility reasons.
For your curiosity: =)
We use `Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)` and have shared
controls with a gamepad.
Players can use arrow keys or the gamepad to navigate the menus. Activating
a menu item is done with a gamepad button / Space or the left mouse button
(LMB).
This maps to a 3D view als well. There players use the LMB or gamepad
button to activate in the center of their view. The mouse movement or right
analog stick are used to change the camera view.
We actually have an option to activate the cursor while in the main menu.
However, the issue is still critical since we also use buttons for each
dialog option in the 3D view (point &* click adventure style). And there we
can't show a mouse cursor as it would break the 3D camera interaction.
It's pretty much identical in all aspects to the Life is Strange game
series.
…On Tue, Aug 9, 2022 at 11:09 PM Hugo Locurcio ***@***.***> wrote:
Note: The issue required as to revert back the godot version since we hide
the cursor and use mouse clicks as "ui_accept" in addition to game-pad
inputs.
Out of curiosity, why are you disallowing mouse cursor input in menus? I
feel this shouldn't be done for accessibility reasons.
—
Reply to this email directly, view it on GitHub
<#64176 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD2IVAHZDS4RHPJMJ77TN3VYLCKFANCNFSM56BZLJJQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The issue when input accumulation is enabled is expected, but we hadn't do a good job so far of letting users know the rules. Namely, you shouldn't send the same input event object multiple times during the same frame. It's not guaranteed to work as expected. It will in some scenarios (no input accumulation, OS layer does not use buffering, etc., etc.; check #64423 for more info). Therefore, the guideline is to instantiate a new event object. That will work always. |
@michael-nischt, can you tell me if the issue about LMB not triggering |
yes, I can confirm: Adding LMB to "ui_accept" to trigger a focused button is not woking in 3.4.5 either. Faking the "ui_accept" as in original sample with Just to be clear: Supporting the LMB in the "ui_accept" list (input map) is not that important to us specifically. We will continue to fake it likein the original example since we only want this behavior when the mouse cursor in captured. Of course, it would be preferrable if that would work without setting |
They are unrelated. If you change your script to look like this, it will work regardless the Godot version and status of event accumulation: if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and not event.is_pressed():
scene_tree.set_input_as_handled()
var evt = InputEventAction.new()
evt.action = "ui_accept"
evt.pressed = true
Input.parse_input_event(evt)
evt = InputEventAction.new()
evt.action = "ui_accept"
evt.pressed = false
Input.parse_input_event(evt) The other issue, LMB not being able to trigger |
Oh this is awesome. Thanks so much for adding the clear warning for future versions and the super clear working example! 🙏 |
Godot version
v3.5.stable.official [991bb6a]
System information
Arch Linux, NVIDIA GeForce RTX™ 3080 Laptop GPU, GLES3
Issue description
Buttons (or probably any controls) don't react to "ui_accept" via a mouse button with the cursor is not over the control.
This happens with the left mouse button added to the "ui_accept" action list (project settings > input map) or if the button triggers a fake InputActionEvent:
Other triggers like the keyboard ENTER key still work fine.
It seems to be a regression as it mouse buttons as "ui_accept" worked just fine in
v3.4.5.stable.official [f9ac000d5]
.Note: The issue required as to revert back the godot version since we hide the cursor and use mouse clicks as "ui_accept" in addition to game-pad inputs.
Steps to reproduce
In Godot v3.5 nothing happens despite a triggered "ui_accept" event.
In Godot v3.4.5 it works as expected.
Note that "ui_accept" bindings (ENTER key) work fine in both versions
Minimal reproduction project
LMB_ui-accept_bug.zip
The text was updated successfully, but these errors were encountered: