mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
On touch screens, press-and-hold equals a secondary click (#4195)
* Closes https://github.com/emilk/egui/issues/3444 * Closes https://github.com/emilk/egui/issues/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.
This commit is contained in:
@@ -174,7 +174,7 @@ impl Keypad {
|
||||
pub fn show(&self, ctx: &egui::Context) {
|
||||
let (focus, mut state) = ctx.memory(|m| {
|
||||
(
|
||||
m.focus(),
|
||||
m.focused(),
|
||||
m.data.get_temp::<State>(self.id).unwrap_or_default(),
|
||||
)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user