{"comment":{"user":{"login":"bluetech","id":1223550,"url":"https://api.github.com/users/bluetech","gravatar_id":"514a1bce6f3b4457b5d27f4d4dc4f72c","avatar_url":"https://secure.gravatar.com/avatar/514a1bce6f3b4457b5d27f4d4dc4f72c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-27T18:40:04Z","path":"src/input.h","updated_at":"2011-12-27T18:40:04Z","id":822457,"html_url":"https://github.com/bluetech/kmscon/commit/dcb6a76e92#commitcomment-822457","position":47,"body":"Hi,\n\nI started the libxkbcommon integration but you inspired me to finish it up today :) Let me tell you, it's a cold world out there with some X server delivering nice events to you. I have put two new branchs in my repo:\n- input-fixed - this fixes a couple of your comments:\n    * Changed the copyright.\n    * Moved the input_device prototypes to input.c.\n    * Also moved the code around a bit (no changes), I hope you have no particular dislike for redundant prototypes..\n- input-xkb - branched of off input-fixed and implements xkb support. You can look at it and try for more details.\n\nAs for your other comments:\n- Is there a specific TODO which worries you?\n- I don't think the input subsystem should deal with unicode too much, it should just deliver events. So I chose to give out a single UCS-4 value in the input event, much like SDL does it. This is also the only ready-made path I found to translate keysyms to unicode. It would also be much trouble to support combining characters (etc..) in the input system - remember that the combining characters come /after/ the base character.\n- Dead keys /should/ be supported through xkb, but libxkbcommon does not handle it. It can tell you when a dead key was pressed (e.g. dead_grave, dead_circum keysyms), but the actual work here is done by Xlib's input method modules. It depends on locale and some text files (see the Compose files and compose.dir file  in /usr/share/X11/locale). It can probably be done but not straightforward without Xlib (and probably also /with/ it).\n- Shortcuts - the modifier state is passed along with every input event.\n\nI should also add the libxkbcommon is not nearly as easy to use as it might appear. You need to duplicate and understand a lot of the X server and Xlib keyboard handling just to start use it. But the alternatives I can think of are:\n- Use some ad-hoc solution directly with the evdev codes - very hard to get something satisfying and otherwise NIH.\n- Port the kernel xkb equivalent (e.g. /usr/share/kbd/*). I think DirectFB does this. I haven't looked at it but probably don't want that either.\nAll in all it works OK now.","url":"https://api.github.com/repos/bluetech/kmscon/comments/822457","line":47,"commit_id":"dcb6a76e92f3b4d99e1f39a3eaa25e073bd656b4"}}