Skip to content

feat(input): Add per-device keyboard and mouse configuration#1

Open
ArthurHeymans wants to merge 9 commits intostefanboca:sb/push-nrusnuxtqozkfrom
ArthurHeymans:KeyboardMiceMultipleInput
Open

feat(input): Add per-device keyboard and mouse configuration#1
ArthurHeymans wants to merge 9 commits intostefanboca:sb/push-nrusnuxtqozkfrom
ArthurHeymans:KeyboardMiceMultipleInput

Conversation

@ArthurHeymans
Copy link
Copy Markdown

This enables users to configure different layouts and settings for individual keyboards and mice by device name. For example, you can now have one keyboard with a US layout and another with US+RU layouts, with automatic XKB switching when typing on different devices.

Changes:

  • Add per-device keyboard layout configuration support
  • Add per-device mouse settings configuration
  • Implement automatic XKB switching based on active keyboard device
  • Refactor Keyboard and Mouse types to support multiple device configs
  • Add Keyboards and Mice collection types with device name lookup
  • Update documentation with per-device configuration examples
  • Preserve numlock state across keyboard switches

Device names are matched case-insensitively from libinput (use sudo libinput list-devices to find device names).

This builds on top of your changes. I suppose I'll rebase against upstream once they are in.

stefanboca and others added 9 commits November 23, 2025 13:50
- change Default impl on Touch to use DEFAULT_TOUCH for consistency
This enables users to configure different layouts and settings for
individual keyboards and mice by device name. For example, you can now
have one keyboard with a US layout and another with US+RU layouts,
with automatic XKB switching when typing on different devices.

Changes:
- Add per-device keyboard layout configuration support
- Add per-device mouse settings configuration
- Implement automatic XKB switching based on active keyboard device
- Refactor Keyboard and Mouse types to support multiple device configs
- Add Keyboards and Mice collection types with device name lookup
- Update documentation with per-device configuration examples
- Preserve numlock state across keyboard switches

Device names are matched case-insensitively from libinput
(use `sudo libinput list-devices` to find device names).

Signed-off-by: Arthur Heymans <[email protected]>
@my4ng
Copy link
Copy Markdown

my4ng commented Jan 8, 2026

Just a note: KeyboardHandle::set_xkb_config is potentially expensive, as the keymap needs to be compiled from the config. Frequent switching between keyboards might lead to performance issues (just a guess, no benchmark). It would be better to cache the compiled Keymap and call KeyboardHandle::update_xkb_state, but that method is private... so there might need to be some changes there.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants