-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Problems with tabs in touch screen #2702
Comments
(Apologies for the late answer) Any item using the This is interesting because I was looking into transitioning more code toward this low-level button behavior to become the default (it's more useful to allow overlap by default) but then I would need a plan for touch devices. On a touch device would need to: The drawback is that adding step 1 would incur one frame of delay for touch device to react to presses. You can probably attempt to implement this on your side. Eventually this is a very good reason to move forward with the idea of implementing a new IO queue (see https://gist.github.com/ocornut/8417344f3506790304742b07887adf9f), because that seems like the most natural way to solve this problem (and also for a standardized answer to #2797, #2334). ( |
(No problem) Thanks, I was planning on doing what you suggest. I was just wondering if I had miss something. |
Hi Omar Thanks for your incredible work. I have tested last version.
with:
But it did not work. The behavior was exactly the same. So, I have done this:
And now it works fine. Is this Ok? I thought that with the new input queue I would not need to do two frames. Carlos |
Fwiw - I've verified for my use cases / UI - that I get the desired behavior on all elements by setting the mouse cursor to invalid. (I used -1, -1 earlier, but that caused a handful of issues with deltas, setting to -F_MAX, -F_MAX and now all behaviors are working OK - also clears up some issues with implot thinking there was an initial large drag due to large values in IO.MouseDelta. Thanks @ocornut - I swear I searched and didn't see this one! ImGui has been awesome as a minimalist library for a really low-resource application. |
…olled with horizontal mouse-wheel (or Shift + WheelY). (#2702)
FYI although that is not the main issue here, I solved this today:
With commit 5f30191 I'll also be looking at the main issue at hand here, since I'll likely do a bit of a push related to touchpad/screen/pen events. |
In essence, the main issue is the need to discriminate the input source, once we can then the fix becomes to add: if (mouse_input_source == TOUCH_SCREEN && mouse_moved)
break; In the code handling the |
Awesome!! Thanks again for your great work!! |
Version/Branch of Dear ImGui:
Dear ImGui 1.72 (17200)
Branch: docking
** Back-end/Renderer/Compiler/OS**
Backend: imgui_impl_win32
Renderer: imgui_impl_dx9
Operating System: Win10
My Issue/Question:
Please note that the backend/renderer are just for emulating the problem.
In a touch screen device I use simulate the mouse events with the touch events, but when the user is not pressing the screen, the mouse position does not update. Usually it works quite well, but I have noticed a problem with the tabs.
If the window that has the tabs does have the focus, clicking on a tab just highlights it, but the tab is not set as current. You have to click a second time to activate it.
If the window that has the tabs does have the focus it works Ok.
And regarding tabs, just a suggestion. It would be fine that when there are more tabs in screen than space available, if you use the mouse wheel in the tabs they scroll so you don't need to go the the arrows to scroll them. Firefox, for example, uses this.
Screenshots/Video
Standalone, minimal, complete and verifiable example:
In the file imgui_impl_win32.cpp add the following lines at the beginning of the function static void ImGui_ImplWin32_UpdateMousePos() (add at line 151)
With this, imgui will receive the mouse events only when a mouse button is pressed.
The text was updated successfully, but these errors were encountered: