Anda di halaman 1dari 1

Creating custom keyboard layouts for X11 using XKB http://hektor.umcs.lublin.pl/~mikosmul/computing/...

Michał K osmulski

Home Creating custom keyboard layouts for


X11 using XKB
CV
:: Minerals, Fossils, M eteorites
Meteory i komety w literaturze License
[PL]
:: Modular Origami
T his artic le is double- lic ens ed under the C reative C ommons A ttribution-
ShareA like L ic ens e and the G N U Free D oc umentation L ic ens e. C ode s amples
:: C omputing
are in the public domain. C ontac t the author if you are interes ted in other
:: Softw are projects
:: Published Articles forms of lic ens ing.
C ustom keyboard layouts C opyright © 2 0 0 4 M ic hał Kos muls ki.
OpenOffice.org macros
Linux and Unicode This document is licensed under the C reative C ommons Attribution-ShareAlike
A K ommander C rash C ourse License
Jak się nie dać zam knąć
[PL]
Permission is granted to copy, distribute and/or modify this document under the terms of the
:: Tips & tricks
GNU Free Documentation License, Version 1.2 or any later version published by the Free
Digital photography
Softw are Foundation; w ith no Invariant Sections, no Front-C over Texts, and no Back-C over
Web development and SEO
Texts. A copy of the license is included in the section entitled "GNU Free Documentation
Links
License".
:: Juliusz Słow acki
C ode samples in this article are hereby put in the public domain.
:: Marian Smoluchow ski
Feedback Disclaimer
Tools T he author dis c laims all warranties with regard to this doc ument, inc luding all
Printable version implied warranties of merc hantability and fitnes s for a c ertain purpos e; in no
event s hall the author be liable for any s pec ial, indirec t or c ons equential
C opyright damages or any damages whats oever res ulting from los s of us e, data or
Unless indicated otherw ise, all
profits , whether in an ac tion of c ontrac t, negligenc e or other tortious ac tion,
content © 2004-2010 Michał aris ing out of or in c onnec tion with the us e of this doc ument.
K osmulski. All rights reserved.
Tips
Download ready-made keyboard layouts
I ns tead of manually modifying keyboard layouts , as des c ribed in the artic le,
you c an download ready- made layout des c riptions and s tart right with the part
whic h des c ribes where they s hould be plac ed and what other files need to be
modified. T wo layouts are available here:
de_pl — the layout us ed as an example in the artic le (phys ic al layout:
G erman, logic al: G erman & P olis h)
pl_de — phys ic al layout: P olis h (= U S E nglis h), logic al: P olis h & G erman
(U mlauts , ß and ¤ bound to A ltG r+1 , A ltG r+2 etc .)
Differences between X.org and XFree86 X servers
A lot of people, inc luding mys elf, have s witc hed from XF ree8 6 to X.org by now,
but the artic le was originally written with XFree8 6 in mind. I f you are us ing
X.org X s erver ins tead of XFree8 6 , file /etc/X11/xorg.conf s hould be modified
ins tead of /etc/X11/XF86Config and /etc/X11/xkb/rules/xorg.{lst,xml} ins tead of
/etc/X11/xkb/rules/xfree86.{lst,xml}.

Assigning unnamed characters to keystrokes


I t is pos s ible to as s ign arbitrary U nic ode c harac ters , even thos e whic h don't
have a name, to keys trokes . For example, a line s uc h as :
key <AC07> { [ j, J, U263A, U263B ] };
binds the U nic ode c harac ters 2 6 3 A and 2 6 3 B (white and blac k s miley fac es )
to A ltG r+J and A ltG r+Shift+J .
T hanks to O s s i V iljakainen for pointing this out.

Creating custom keyboard layouts for X11 using


XKB
I n mos t modern des ktop environments there is a s mall applet that allows
us ers to quic kly s witc h between keyboard layouts when they need to type text
in more than one language. H owever, there are s ituations where this s olution
is not quite s atis fac tory. Some writing jobs (that of a trans lator, for example)
require writing text in whic h words from s everal languages are intermixed,
whic h would make frequent s witc hes between keyboard layouts nec es s ary.
T his is a big inc onvenienc e, even when keyboard s hortc uts are us ed to s witc h
between layouts . A nother problem is that the logic al keyboard layouts us ed
may s ometimes not fit the phys ic al keyboard layout very well, res ulting in a
c onfus ing s etup.
1 of 1 17/02/2011 09:42 πμ
O ne s olution is to us e layouts with s o c alled dead keys . T his is a way of
generating ac c ented c harac ters by firs t pres s ing a key whic h c orres ponds to
the ac c ent (the dead key) and then a letter key (e.g. pres s ing ~ and then n
generates ñ). T his allows you to generate many ac c ented c harac ters us ing

Anda mungkin juga menyukai