-
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach better than the alternative in #4986
crates/egui/src/input_state.rs
Outdated
/// Input state management configuration. | ||
input_options: InputOptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.rs
and puts them in aInputOptions
struct that then gets added toOptions
. This allows adjusting these values at runtime, for example, to increaseMAX_CLICK_DIST
for touchscreen usage.