Skip to content

Instantly share code, notes, and snippets.

@ryanabx
Created March 22, 2024 18:02
Show Gist options
  • Save ryanabx/e18b70d58f651c1a6946a5bca7a11165 to your computer and use it in GitHub Desktop.
Save ryanabx/e18b70d58f651c1a6946a5bca7a11165 to your computer and use it in GitHub Desktop.

Touchpad Gesture Config Idea 1

Notes:

  • The design of the settings page doesn't have to mirror the level of configurability of the underlying config, BUT the config can't be simply as low level as 3-finger-swipe-down: next_workspace, due to changing workspace orientation.
  • Despite the limitation above, we should strive for a customizable system under-the-hood, so that people who'd like to heavily modify their workflow may do so without restriction.
  • We should balance that need with a user interface that doesn't confuse the average user.

1: Workspace Direction Dependent Configuration

Idea: Have some (or all, but not ideal) x-finger gesture configurations dependent on workspace orientation

Pros:

  • Window switching gestures (i.e. window focus up/down/left/right) should be workspace orientation independent, this makes that configuration a lot easier
  • Only the number of fingers that are dependent on workspaces has to have a more complex config

1.a Config Layout in code

// enum/struct names subject to change

struct GestureConfig {
    three_finger: FingerGestureConfig,
    four_finger: FingerGestureConfig,
    five_finger: FingerGestureConfig
}

enum FingerGestureConfig {
    WorkspaceDependent(WorkspaceDependentGestureConfig),
    Directional(DirectionalGestureConfig)
}

struct WorkspaceDependentGestureConfig {
    action_forward: String,
    action_backward: String,
    action_side_1: String,
    action_side_2: String
}

struct DirectionalGestureConfig {
    action_up: String,
    action_down: String,
    action_left: String,
    action_right: String
}

1.b How config could be applied to settings

With this kind of system, we can allow configurability in the low-level plaintext config file, while permitting the UX team to allow or restrict as much of the customization as possible.

Some rough ideas on how to apply the config to a settings page:

  1. Each amount of fingers can be configured to either workspace swiping (default 4 finger), window switching (default 3 finger) and custom gestures (default 5 finger). Custom gestures can be defined by direction only, and the other types aren't configurable other than how many fingers triggers them.

  2. Restrict configuration in settings entirely

  3. Full customization (likely not user friendly), for each finger, you may select whether it is workspace orientation dependent or not, and which action to activate for each direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment