-
Notifications
You must be signed in to change notification settings - Fork 1.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
Secondary click on mobile #865
Comments
This may collide with the long tap from #501 .. This is also a problem on desktop web, where the native context menu is overridden because egui catches the mouse events. But I am unsure if this is really circumventable, because not all platforms have a native context menu, so I guess the best egui can do is try to create a native context menu when asked to and if one exists. This could allow us to use native context menus on mobile. |
It's unclear how to best implement this. Should Anyone wants to try experimenting with this? |
I wanted to try to implement this some time, but I can't say when I want to start yet.. most probably a drag event will only be created when the pointer moves out of a fixed radius or something similar. Might do some research about how this is usually implemented. Another thing is that the distinction between mouse click and touch screen touch seems to sometimes disappear in egui.. I am not sure but we might need to make that more clear to prevent secondary clicks being triggered when holding the left mouse button down. In other words, the long tap should not apply for left mouse button clicks. |
* Closes emilk#3444 * Closes emilk#865 On a touch screen, if you press down on a widget and hold for 0.6 seconds (`MAX_CLICK_DURATION`), it will now trigger a secondary click, i.e. `Response::secondary_clicked` will be `true`. This means you can now open context menus on touch screens.
Recently, context menus got added, but they can't be used on mobile because there is no way to perform a secondary click.
Usually, a long tap is interpreted as a secondary click. The default context menu may not be suitable for mobile, because it is too small, but being able to trigger it with the same code as on desktop is a first step for bringing this feature.
The text was updated successfully, but these errors were encountered: