Skip to content
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

Feature request: Trackpad zones for layer switching using thumbs #1401

Open
nahuel opened this issue Dec 5, 2024 · 2 comments
Open

Feature request: Trackpad zones for layer switching using thumbs #1401

nahuel opened this issue Dec 5, 2024 · 2 comments
Labels
enhancement New feature or request PRs welcome jtroo has no plans to work on this at present, but PRs are welcome

Comments

@nahuel
Copy link

nahuel commented Dec 5, 2024

Is your feature request related to a problem? Please describe.

Laptop keyboards don't have thumb buttons or at least a split spacebar (only Thinkpads have integrated mouse buttons that can be used as such).

Describe the solution you'd like.

Similar to #108 , IMHO it will be very useful and ergonomic to use the trackpad to switch layers using thumbs (without requiring Thinkpad-like mouse buttons). This can be done by listening for trackpad touchs (not clicks). So when the thumb starts touching the trackpad, kanata can emit some key-down event that can be mapped to a layer switch, and when the thumb stops touching the trackpad, the key-up event will be emitted and the layer will be disabled.

Note that this doesn't conflict with normal trackpad usage if an unused keycode is chosen (or if there is no keycode at all and is only mapped to an internal kanata event), because you usually don't use the keyboard while using the trackpad for pointer movement, so it doesn't matter if a layer switch happens while moving the pointer using the trackpad.

This functionality can be extended by defining multiple trackpad zones for multiple keys/layers, that can be used simultaneously with the two thumbs. E.g.

┌───┐
│   │  Single zone, whole trackpad "button"
└───┘
┌─┬─┐
│ │ │  Split in half, one half for each thumb, three possible "button" combinations/layers
└─┴─┘
┌─┬─┐
├─┴─┤  Three possible "buttons"
└───┘
┌─┬─┐
├─┼─┤  Advanced user :)
└─┴─┘

Will be nice to give the user the possibility of defining arbitrary zones by configuring rectangle zones using touchpad coordinates. Additionally you can put some stickers over the trackpad to have more visual trackpad "buttons" :)

Describe alternatives you've considered.

Additional context

@nahuel nahuel added the enhancement New feature or request label Dec 5, 2024
@jtroo
Copy link
Owner

jtroo commented Dec 5, 2024

On Linux seems EV_ABS might be usable if the touchpad emits the event.

https://docs.kernel.org/input/event-codes.html

Unsure about Windows and macOS.

@jtroo jtroo added the PRs welcome jtroo has no plans to work on this at present, but PRs are welcome label Dec 5, 2024
@mayurankv
Copy link

Haven't worked with it so unfamiliar with how it works, but Karabiner has a multitouch extension which I understand works off the same daemon: https://karabiner-elements.pqrs.org/docs/manual/misc/multitouch-extension/

This could hopefully help with Mac mouse actions too. Unfortunately I'm not familiar with Karabiner so I'm not able to contribute this myself :((. Will try and take a look but unlikely to be much help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PRs welcome jtroo has no plans to work on this at present, but PRs are welcome
Projects
None yet
Development

No branches or pull requests

3 participants