-
Notifications
You must be signed in to change notification settings - Fork 34
feat: Gesture configuration in shortcuts config #63
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
base: master
Are you sure you want to change the base?
Conversation
23542a8 to
93f7fb1
Compare
|
Rebased on latest master. Can I get a review soon if there's any free time? |
config/src/shortcuts/gesture.rs
Outdated
|
|
||
| impl Gesture { | ||
| /// Creates a new gesture from a number of fingers and a direction | ||
| pub fn new(fingers: impl Into<u32>, direction: impl Into<Direction>) -> Gesture { |
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 don't think there's a need for generic input parameters here. Use of constant types will prevent unnecessary monomorphization and inlining.
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 in v3. Also made fingers an enum, to limit the fingers that can be used as gestures. Unsure if this is something we want or not
config/src/shortcuts/mod.rs
Outdated
| let mut gestures = context | ||
| .get::<Gestures>("default_gestures") | ||
| .unwrap_or_else(|why| { | ||
| tracing::error!("shortcuts defaults config error: {why:?}"); |
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.
Use if why.is_err() {} to check if the error is worth logging. Otherwise this will spam the logs if the config is not in use.
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 in v2.
I assume I shouldn't do the same for the custom gestures?
34c9e55 to
fdf1f1b
Compare
This commit adds a Gesture abstraction, which can define gestures by the number of fingers used, and the direction the gesture is performed in. The abstraction is modeled after the Binding type, and the resulting Gestures type is similar to the Shortcuts type. This is the first step in implementing configurable touchpad gestures (pop-os/cosmic-comp#396) Signed-off-by: Ryan Brue <[email protected]>
|
I may have some time to look into the cosmic-comp side of this soon, but I want to see first if this is a good enough implementation of the gesture configuration. CC: @Drakulix |
This commit adds a Gesture abstraction, which can define gestures by the number of fingers used, and the direction the gesture is performed in.
The abstraction is modeled after the Binding type, and the resulting Gestures type is similar to the Shortcuts type.
This is the first step in implementing configurable touchpad gestures (pop-os/cosmic-comp#396)
Let me know what needs to be changed!