Add Options::input_options for click-delay etc - #4942
Conversation
|
Background on the PR: I'm working on a UI for a touchscreen device and I've found that the default Thoughts on this? I don't quite like that I had to stash (Maybe outside the scope of this PR, but maybe we could consider separate config values for mouse vs touch? The latter is much less precise. From a quick glance, this would require changing some of the plumbing that translates touch events into |
| /// Input state management configuration. | ||
| input_options: InputOptions, |
There was a problem hiding this comment.
We should note here that this is copied from egui::Options at the start of each frame, and is only here for convenience
There was a problem hiding this comment.
Done. Let me know if you think Arc would be a better solution here. Currently it's just a couple of floats, so performance wise it might be a wash between Arc and copying the floats.
This takes 3 hardcoded constants from `input_state.rs` and puts them in a `InputOptions` struct that then gets added to `Options`. This allows adjusting these values at runtime, for example, to increase `MAX_CLICK_DIST` for touchscreen usage.
d2b52f6 to
0e36e62
Compare
Options::input_options for click-delay etc
This takes 3 hardcoded constants from `input_state.rs` and puts them in a `InputOptions` struct that then gets added to `Options`. This allows adjusting these values at runtime, for example, to increase `MAX_CLICK_DIST` for touchscreen usage. * [x] I have followed the instructions in the PR template
This takes 3 hardcoded constants from
input_state.rsand puts them in aInputOptionsstruct that then gets added toOptions. This allows adjusting these values at runtime, for example, to increaseMAX_CLICK_DISTfor touchscreen usage.