Remapping keys in X

brokenladder ulist at gs1.ubuntuforums.org
Mon May 23 03:31:18 UTC 2005


This may not be directly related to what you're asking, but some
relevant information that I certainly would have enjoyed knowing before
having to figure it out on my own.



The new system for keymapping is xkb, or at least what xorg is geared
toward using, right?  While xmodmap configuration is a breeze, xkb
isn't that hard to configure.  I use a dvorak keymap, but I also type
Esperanto often as a hobby online.  I know, I'm the ultimate geek.  But
in any case, here's how I went about editing my dvorak keymap so that it
would support characters like ĉ, ĝ, ĥ, ŝ, ĵ,
etc.  I also added in € æ ® ©, etc. for the heck of it.  You choose
these all by hitting third-level chooser, as I recall.  So in this
case, I hold down right-alt, and press u for instance, and I get
ubreve, which is ŭ.  This is really handy if you want to be able
to type special characters whether to type Bjork's name properly with
the umlats, or to add in mathematical symbols.



I edited /etc/X11/xkb/symbols/pc/dvorak in this case (you can find the
keymap file for your selected language) to look as follows:



> 

> // based on a keyboard map from an 'xkb/symbols/dk' file

> //

> // $XFree86: xc/programs/xkbcomp/symbols/pc/dvorak,v 1.2 2003/04/19
> 12:22:11 pascal Exp $

> 

> partial default alphanumeric_keys

> xkb_symbols "basic" {

> 

> name[Group1]= "Dvorak";

> 

> // Alphanumeric section

> 

> key <TLDE> { [       grave,	asciitilde, dead_grave, dead_tilde	]
> };

> 

> key <AE01> { [	    1,	exclam 		]	};

> key <AE02> { [	    2,	at		]	};

> key <AE03> { [	    3,	numbersign	]	};

> key <AE04> { [	    4,	dollar,	cent]	};

> key <AE05> { [	    5,	percent		]	};

> key <AE06> { [	    6,	asciicircum, dead_circumflex, dead_circumflex
> ]	};

> key <AE07> { [	    7,	ampersand	]	};

> key <AE08> { [	    8,	asterisk	]	};

> key <AE09> { [	    9,	parenleft,  dead_grave]	};

> key <AE10> { [	    0,	parenright	]	};

> key <AE11> { [ bracketleft,	braceleft	]	};

> key <AE12> { [ bracketright, braceright,  dead_tilde] };

> 

> key <AD01> { [  apostrophe,	quotedbl, dead_acute, dead_diaeresis	]
> };

> key <AD02> { [	comma,	less,   dead_cedilla, dead_caron	] };

> key <AD03> { [      period,	greater, dead_abovedot,
> periodcentered	] };

> key <AD04> { [	    p,	P		]	};

> key <AD05> { [	    y,	Y, yen		]	};

> key <AD06> { [	    f,	F		]	};

> key <AD07> { [	    g,	G, gcircumflex, Gcircumflex ]	};

> key <AD08> { [	    c,	C, ccircumflex, Ccircumflex ]	};

> key <AD09> { [	    r,	R, registered, copyright]	};

> key <AD10> { [	    l,	L		]	};

> key <AD11> { [	slash,	question	]	};

> key <AD12> { [	equal,	plus		]	};

> 

> key <AC01> { [	    a,	A, ae, AE		]	};

> key <AC02> { [	    o,	O		]	};

> key <AC03> { [	    e,	E, EuroSign, cent	]	};

> key <AC04> { [	    u,	U, ubreve, Ubreve ]	};

> key <AC05> { [	    i,	I		]	};

> key <AC06> { [	    d,	D		]	};

> key <AC07> { [	    h,	H, hcircumflex, Hcircumflex ]	};

> key <AC08> { [	    t,	T		]	};

> key <AC09> { [	    n,	N		]	};

> key <AC10> { [	    s,	S, scircumflex, Scircumflex		]	};

> key <AC11> { [	minus,	underscore	]	};

> 

> key <AB01> { [   semicolon,	colon, dead_ogonek, dead_doubleacute ]
> };

> key <AB02> { [	    q,	Q		]	};

> key <AB03> { [	    j,	J, jcircumflex, Jcircumflex ]	};

> key <AB04> { [	    k,	K		]	};

> key <AB05> { [	    x,	X		]	};

> key <AB06> { [	    b,	B		]	};

> key <AB07> { [	    m,	M		]	};

> key <AB08> { [	    w,	W, ubreve, Ubreve ]	};

> key <AB09> { [	    v,	V		]	};

> key <AB10> { [	    z,	Z		]	};

> 

> };

> 

> // Norwegian Dvorak

> partial alphanumeric_keys 

> xkb_symbols "no" {

> include "pc/dvorak(basic)"

> 

> key <TLDE> { [	  bar,	section, brokenbar, paragraph	] };

> 

> key <AE01> { [	    1,	exclam, exclamdown, onesuperior	] };

> key <AE02> { [	    2,	quotedbl,   at,     twosuperior	] };

> key <AE03> { [	    3,	numbersign, sterling, threesuperior ] };

> key <AE04> { [	    4,	dollar,     currency,onequarter	] };

> key <AE05> { [	    5,	percent,    onehalf,	onehalf	] };

> key <AE06> { [	    6,	ampersand,  threequarters, threequarters ]
> };

> key <AE07> { [	    7,	slash,      braceleft, division	] };

> key <AE08> { [	    8,	parenleft,  bracketleft		] };

> key <AE09> { [	    9,	parenright, bracketright	] };

> key <AE10> { [	    0,	equal,	    braceright		] };

> key <AE11> { [	 plus,	question,   plusminus, questiondown ] };

> key <AE12> { [   backslash,	grave,	    dead_acute,	dead_grave  ]
> };

> 

> key <AD01> { [       aring,	Aring,  braceright, bracketright ] };

> key <AD02> { [	comma,	semicolon, dead_cedilla, cedilla ] };

> key <AD03> { [      period,	colon,  periodcentered		 ] };

> key <AD04> { [	    p,	P,      thorn,	THORN		 ] };

> key <AD05> { [	    y,	Y,      yen			 ] };

> key <AD06> { [	    f,	F,      ordfeminine		 ] };

> key <AD08> { [	    c,	C,      ccedilla, copyright	 ] };

> key <AD09> { [	    r,	R,      registered		 ] };

> key <AD11> { [  apostrophe,	asterisk, dead_circumflex, acute ] };

> key <AD12> { [  asciitilde,	asciicircum, dead_diaeresis,
> dead_tilde	] };

> 

> key <AC03> { [	    e,	E,      EuroSign,	cent	 ] };

> key <AC05> { [	    i,	I,      idotless,       Iabovedot] };

> key <AC06> { [	    d,	D,      eth,		ETH	 ] };

> key <AC10> { [	    s,	S,      ssharp			 ] };

> key <AC11> { [	minus,	underscore, hyphen,	diaeresis] };

> 

> key <AB01> { [	   ae,	AE,     braceleft,	bracketleft] };

> key <AB05> { [	    x,	X,      multiply		 ] };

> key <AB07> { [	    m,	M,	mu			 ] };

> key <BKSL> { [	 less,	greater, guillemotleft, guillemotright	] };

> 

> key <SPCE> { [	 space,	space, nobreakspace, nobreakspace] };

> 

> key <LSGT> { [	oslash,	Ooblique,  bar,	backslash	 ] };

> 

> };

> 

> // Swedish Dvorak

> partial alphanumeric_keys 

> xkb_symbols "se" {

> include "pc/dvorak(no)"

> 

> key <TLDE> { [     section,	onehalf		]	};

> 

> key <AE04> { [	    4,	currency,   dollar,    onequarter	] };

> key <AE11> { [        plus,	question,   backslash, questiondown	]
> };

> key <AE12> { [  dead_acute, dead_grave, backslash, grave		] };

> 

> key <AD01> { [  odiaeresis,  Odiaeresis, braceright, bracketright	]
> };

> key <AD02> { [       aring,	Aring	  	]	};

> key <AD03> { [  adiaeresis,	Adiaeresis	]	};

> key <AD11> { [           q,	Q       	]	};

> key <AD12> { [ dead_diaeresis, dead_circumflex, dead_tilde,
> asciicircum ] };

> 

> key <AB01> { [     comma,    semicolon, dead_cedilla, cedilla	] };

> key <AB02> { [    period,    colon,     periodcentered		] };

> 

> key <BKSL> { [      less,	greater,    bar,	brokenbar	] };

> 

> key <LSGT> { [ apostrophe,   asterisk,  bar,	backslash	] };

> 

> };

> // Swedish Dvorak alias

> partial alphanumeric_keys 

> xkb_symbols "sv" {

> include "pc/dvorak(se)"

> };

>


-- 
brokenladder




More information about the ubuntu-users mailing list