Skip to content
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

Touchpad tap to click not captured when io.ConfigInputTrickleEventQueue is false #7886

Closed
kyle-sylvestre opened this issue Aug 14, 2024 · 5 comments
Labels

Comments

@kyle-sylvestre
Copy link

Version/Branch of Dear ImGui:

Version 1.91.1 WIP, Branch: master

Back-ends:

imgui_impl_metal.cpp + imgui_impl_osx.cpp

Compiler, OS:

macOS + Clang 15

Full config/build information:

No response

Details:

Tapping to click with a laptop touchpad fails when io.ConfigInputTrickleEventQueue is false. I have replicated this problem on a Windows 10 laptop and a Macbook M3 Air.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::GetIO().ConfigInputTrickleEventQueue = false;
ImGui::Begin("Touchpad Example");
static bool b;
ImGui::Checkbox("Untappable", &b);
ImGui::End();
@kyle-sylvestre kyle-sylvestre changed the title Touchpad click not captured when io.ConfigInputTrickleEventQueue is false Touchpad tap to click not captured when io.ConfigInputTrickleEventQueue is false Aug 14, 2024
@ocornut
Copy link
Owner

ocornut commented Aug 14, 2024

Yes that’s the point of this feature, it must not be disabled on a touchpad.

@ocornut
Copy link
Owner

ocornut commented Aug 14, 2024

I am curious about why you tried to disable it?
I will try to amend comments to clarify its purpose.

@kyle-sylvestre
Copy link
Author

kyle-sylvestre commented Aug 14, 2024

Turning trickle off lets me display characters in an InputText() as soon as possible. Ideally I'd only want the mouse down/up trickle since these touchpad taps are not getting captured.

@ocornut
Copy link
Owner

ocornut commented Aug 14, 2024

Turning trickle off lets me display characters in an InputText() as fast as possible.

You are correct that in the current version, there is a 1 frame delay processing characters because of this code.
This is caused by fa2b318
I am surprised that I didn't comment further on this when pushing this. I was eager to "fix" the issue outside of InputText() that I didn't fix this well enough, and it may feel different depending on whether your backend submits characters or keys first.

With

[03322] [io] Processed: Key "H" Down
[03322] [io] Remaining: Text: h (U+00000068)
[03323] [io] Processed: Text: h (U+00000068) <-- processed by `InputText()`

Without

[05931] [io] Processed: Key "H" Down
[05931] [io] Processed: Text: h (U+00000068) <-- processed by `InputText()`

I believe an issue should be open for this, ideally we could aim to find a way to disable some of the trickling better for text input. I don't have the solution yet but I can investigate.

@kyle-sylvestre
Copy link
Author

I agree, I'll make a new issue referencing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants