Not logged in
Log in now
Create an account
Subscribe to LWN
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Little things that matter in language design
LWN.net Weekly Edition for June 6, 2013
Wayland and Weston 1.0 released
Posted Oct 25, 2012 4:20 UTC (Thu) by amtota (guest, #4012)
Going forward, what we need to do is to use the Xkb x11 api rather than the core keyboard api to get a full and exact keymap copy.
Until then, the code in latest version (0.7.1) works well enough for most, including multiple layouts and keyboard switching.
Posted Oct 25, 2012 7:41 UTC (Thu) by michaeljt (subscriber, #39183)
> Right. With xpra on posix platforms we try (...) to copy the keymap across, with win32 and osx clients it gets a little bit more complicated.
> Going forward, what we need to do is to use the Xkb x11 api rather than the core keyboard api to get a full and exact keymap copy.
Right, Windows and OS X have a nearly (ahem, Microsoft think AltGr is the same as Ctrl+Alt) fixed relationship between key codes and physical key positions on a PC-like keyboard. X11 doesn't, but XKB can give you good information to find out the relationship.
Posted Oct 25, 2012 9:53 UTC (Thu) by michaeljt (subscriber, #39183)
That is, unless there is some way I am unaware of of finding out the mapping for a well known keyboard layout (e.g. US) for the current system via the X protocol - preferably a method which doesn't depend on XKB.
Posted Oct 26, 2012 11:36 UTC (Fri) by daniels (subscriber, #16193)
Such a mapping doesn't necessarily exist: what if you're not using a PC keyboard at all, but have a weird phone-style keyboard? Or if your backend is, say, OS X, which has a slightly different approach to handling keycodes?
The best you can do right now is take the rules and model of the mapping you want to compare to, and compile a keymap with the same rules and model, but with the layout set to 'us'. And that might work, in the most case.
In any case, XKB, painful though it is, is _the_ keyboard mapping for X11, and that's never going to change. Not least because it's exposed at all levels through the totally immutable Xlib ABI.
Posted Oct 26, 2012 11:51 UTC (Fri) by michaeljt (subscriber, #39183)
For my purposes XKB is not particularly painful - dealing with Windows oddities is much worse. The only reason that XKB-less methods interest me is for dealing with servers which don't have it. Not sure how many that is these days, but I am sure that some VNC-like servers will fall into that category - and tend to be rather interesting from a keyboard handling point of view.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds