-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gestures: Implement configurable gestures using new cosmic-settings-d…
…aemon config This commit adds very very simple configurable touchpad gestures, starting with next and previous workspace. We need to add support for more actions at some point, but this is a good start. Signed-off-by: Ryan Brue <[email protected]>
- Loading branch information
Showing
7 changed files
with
75 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use cosmic_comp_config::workspace::WorkspaceLayout; | ||
use cosmic_settings_config::shortcuts::{self, action::Direction, Gestures}; | ||
|
||
pub fn add_default_gestures(gestures: &mut Gestures, workspace_layout: WorkspaceLayout) { | ||
// TODO: Do we take into account natural scroll? | ||
let (workspace_forward, workspace_backward) = match workspace_layout { | ||
WorkspaceLayout::Vertical => (Direction::Up, Direction::Down), | ||
WorkspaceLayout::Horizontal => (Direction::Left, Direction::Right), | ||
}; | ||
|
||
gestures.insert_default_gesture( | ||
4 as u32, | ||
workspace_forward.clone(), | ||
shortcuts::Action::NextWorkspace, | ||
); | ||
|
||
gestures.insert_default_gesture( | ||
4 as u32, | ||
workspace_backward.clone(), | ||
shortcuts::Action::PreviousWorkspace, | ||
); | ||
|
||
// TODO: More default gestures? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters