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

Provide API for accessing and configuring input devices #6

Open
Cloudef opened this issue Feb 26, 2015 · 7 comments
Open

Provide API for accessing and configuring input devices #6

Cloudef opened this issue Feb 26, 2015 · 7 comments
Labels

Comments

@Cloudef
Copy link
Owner

Cloudef commented Feb 26, 2015

Multiple keyboards with different layouts and rules is useful.
So may be other device specific configuration (like disabling touchpad and so on).

@Cloudef Cloudef changed the title Provide API for accessing and configuring keyboards Provide API for accessing and configuring input devices Feb 26, 2015
@wasamasa
Copy link

The general idea is that hacks like detecting a plugged in keyboard and setting keyboard options for the currently plugged one with a script are very brittle and hard to pull off correctly.

Xorg offers you to set XKB options both generally and for matching devices, with that functionality one can have keyboard-specific options that just work. It appears as if all keyboard input is matched against the device information and specified options.

Own config.

@Cloudef
Copy link
Owner Author

Cloudef commented Aug 25, 2015

For now I exposed libinput devices in wlc.h, this probably makes most sense. But I keep this issue open if there are problems.

@Cloudef
Copy link
Owner Author

Cloudef commented Aug 25, 2015

I also exposed xkb_keymap and xkb_state, however no multiple keyboards yet nor layout configuration ...

@wasamasa
Copy link

I've handed in an enhancement request for libinput: https://bugs.freedesktop.org/show_bug.cgi?id=98194

@klardotsh
Copy link

Yep, I'm considering moving to Sway from AwesomeWM on Xorg, but I use dvorak - software on my laptop's internal keyboard, and hardware on my ErgoDox EZ. It took some fighting with xorg.conf, but it was doable. I see no real way of doing this in any wayland compositor I've looked into so far, short of using an XKB toggle key (maybe the AppMenu key? That annoying thing bound to Fn+RCtrl on my laptop internal board?)

@Earnestly
Copy link
Contributor

Earnestly commented Oct 19, 2016

All of those Xkb* options are exposed via environment variables which xkbcommon uses, e.g. XKB_DEFAULT_LAYOUT, XKB_DEFAULT_OPTIONS, XKB_DEFAULT_VARIANT, etc.

They all accept the same format and arguments as the xorg.conf.

@wasamasa
Copy link

wasamasa commented Feb 2, 2017

@iv597 I finally solved this in a global manner by writing my own hwdb rules that match per device, that way I only need to enable a compose key rule in Xorg (with setxkbmap or a config option) and Wayland (with XKB_DEFAULT_OPTIONS). In other words, I'm inclined to close this issue, but won't as there's a linked one that cannot be solved this way.

Relevant commit: wasamasa/dotfiles@ca08251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants