[kmscon-devel] Add --xkb-keymap option

Ran Benita ran234 at gmail.com
Sun Mar 10 15:11:53 PDT 2013


On Sun, Mar 10, 2013 at 01:32:05PM +0100, David Herrmann wrote:
> I was also thinking of adding a built-in keymap fallback that can be
> used if none is found on the system. The build-system already provides
> a way to link any raw text/binary file into the executable so it would
> be really easy to implement with this patch.

That's really nice, didn't think to do it with the linker. A basic
keymap can be made quite small (still in text form). And it would be
like the dumb_kbd backend comeback for free :)

> However, I'd prefer using xkb_keymap_new_from_string() instead of
> _from_file(). This would allow passing either a pointer to the
> built-in keymap or to the mmap()'ed file. I can adjust the patch
> myself, but I first wanted to hear your opinion on it.

Sounds good to me, mmap'ing the file might even be faster (I haven't
looked what flex does with a FILE*, but probably it just fread()'s it).

One caveat though is that the string needs to be NUL-terminated, there's
no size parameter. That's one API oversight. So if the file happens to
be a multiple of the page size... But I think there are ways to work
around that.

> Btw., if keyboards get you bored and you need some new fancy projects,
> how about doing a similar library for mice? That is, turning
> xf86-input-synaptics into a library ;)

Well, as an off-topic side note, I once read this document:
http://www.ccs.neu.edu/home/shivers/papers/sre.txt
And since then I try to keep in mind the stuff he talks about in the
preamble. So clearly I'm still in the early stages with the keyboards :)
But thanks for the suggestion, I might persue it when school is off
again (if no one else does until then).


More information about the kmscon-devel mailing list