-
|
Hello 👋🏻 I'm rendering my UI in VR space and want user to control it with laser pointer. In general it works but I have problem with buttons rejecting my triggers because laser pointer moves too much when user is pressing the trigger (one has to very carefully keep controller in place). Is there a way to control that behaviour to allow bigger movement before EGUI decides it's a drag instead of click? Currently I'm doing that manually (reporting pointer to stay in the same position before it moves more than X units) but I'm afraid it will mess up other controls, eg. sliders. I'm kinda assuming that controls that do not click will ignore that threshold and start dragging right away but I'm not very experienced with UIs tbh. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
That is controlled by the egui/crates/egui/src/input_state/mod.rs Lines 20 to 38 in 6ccb768 It's not in the docs for some reason, but it is a public type, and you can modify it like this: ui.ctx().options_mut(|opt| {
opt.input_options.max_click_dist = 200.0;
opt.input_options.max_click_duration = 1.0;
}); |
Beta Was this translation helpful? Give feedback.
That is controlled by the
InputOptionsstruct:egui/crates/egui/src/input_state/mod.rs
Lines 20 to 38 in 6ccb768