Section names, as in xkb_keycodes "name-here", are irrelevant at this point and can be omitted. C++ style comments, // till the end of line, are allowed. xkb file produced by xkbcomp(1) is a simple text file. Whenever possible, make the changes gradually and test them. Start with whatever default configuration your server has. There is only one possible action for each (keysym, state) pair. Actions do not generally affect keysyms, and generating a keysym is not an action. Keysym obtained from the table above can also trigger some action:įor XKB, setting or locking a modifier bit is an action, and so is any X server interaction like switching consoles, terminating the server, moving pointer etc. Making Ctrl+h combination generate Backspace keysym with no Control bit set is an XKB task, too, but it is much more difficult to implement than Control+Backspace. Alternatively, XKB can be used to make Ctrl+h combination generate Backspace keysym with Control bit set in this case, rxvt will not see any difference between physical Backspace key and h key as long as Ctrl key is pressed. This way rxvt will receive h keysym with Control bit set in the state value, and it will be clearly different from Backspace keysym. Generally it is XKB task to provide different keysyms, but states are handled later by individual applications.Īlso, states in XKB have somewhat delayed effect, that is, you must have the state set prior to pressing a key.Įxample: Ctrl+h can be configured to act as backspace in rxvt (application setting). In X terms, a and Ctrl+a means same keysym and different states, but a and A are different keysyms. For example, a typical alphanumeric key is only affected by Shift, so its type is set to TWO_LEVEL, and Types are used to tell which modifiers affect which keys essentially it is a way to reduce the third dimension of S. With S being the translation table (actually called xkb_symbols, see below). Internally, the translation involves additional steps: Group typically represents a "layout", as in US-English, French-AZERTY, Russian, Greek etc. XKB works mostly at the XLookupString stage, transforming incoming keycode into keysym according to its own internal state, which is group and state values: Keysyms are only important when an application expects some particular values typically that is keys like arrows, Enter, Backspace, F-keys, and various shortcuts. However, the number is what clients actually receive. A lot of them have names, declared in /usr/include/X11/keysymdef.h with KP_ prefix. Client applications typically only check the bits they need, so an application with normal keyboard input and Ctrl+key shortcuts usually makes no distinction between Control and Control+Mod3 states. The bits in the state field have pre-defined names: Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4 and Mod5, lowest to highest. Keysym and corresponding string is what the client obtained using XLookupString(3) and friends. Keycode together with the state value is what X sends to the application in XKeyEvent(3) structure. The state represents modifier keys, 0x01 is Shift. Keycode 21 is what input device supplied to X, typically a physical key index of some sort. Note keycode 21, state 0x1 and keysym 0x2b aka plus. State 0x1, keycode 21 (keysym 0x2b, plus), same_screen YES, $ xev -event keyboard KeyPress event, serial 45, synthetic NO, window 0x2200001, Use xev (package xorg-xev) to get keycodes and to check how your keymap works. The core XKB functionality is quite simple, and it is necessary to have an idea on how it works before working on the keymaps. Also, there is no problem changing XKB configuration while X is running. Note that unlike standard system-wide configuration via nf(5), this is a per-user keymap. Test -f ~/.Xkeymap & xkbcomp ~/.Xkeymap $DISPLAY Once the layout is ready, save it as ~/.Xkeymap and make ~/.xinitrc load it on startup: It will, however, check the syntax and report errors. xkm file, without uploading anything to the server. Note that without $DISPLAY argument xkbcomp(1) will try to compile. To upload the data back to the server, run Use xkbcomp(1) (package xorg-xkbcomp) to manipulate XKB data. Note: Even if you faithfully recreate a working setxkbmap(1) command as an Xorg configuration file, it might not take effect at all due to Xorg bugs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |