xkb on maemo - problems generating level3 left and right
Michael Graham
magog at the-wire.com
Mon Jun 23 12:16:26 PDT 2008
I've been using a non-standard cursor key setup for awhile now.
It's kind of like the inverted T cursors, but on the home row.
CAPS+I/J/K/L is the same as up/left/down/right.
CAPS is set to be a ISO_Level3_Shift key. The arrow keys are
put on level3 and level4.
I've had this working in Ubuntu for awhile. Now I'm trying to get
it to work on my Maemo device (Nokia N810) with my bluetooth keyboard.
On the N810, I'm getting some strange results. Unshifted: Up and Down
work fine, but Left and Right do not. In other words, holding down
CAPS+J does nothing, but CAPS+I moves the cursor up a line as expected.
The shifted forms of all four keys work fine. In other words, holding
down CAPS+SHIFT+J extends the selection to the left in a GTK widget.
I'm really at a loss. I've scoured all the xkb files that Nokia
shipped, trying to find some special handling for "left" and "right"
vs. "up" and "down", but I'm coming up empty.
I've tried two bluetooth keyboards so it doesn't appear to be hardware
related. Also, I've tried remapping left and right to different letters
on the keyboard, so it doesn't look like it's a specific
problem with the J and L keys.
BTW, the main reference for figuring this stuff out was here:
http://osdir.com/ml/xfree86.internationalization/2004-04/msg00010.html.
(Although that example uses a Dvorak layout and Alt for the level3
switch.)
This is my /usr/share/X11/symbols/mag:
== cut here ==
English - with home-row cursor keys";
// CAPSLOCK is a mode switch key to level3
key <CAPS> {
symbols[Group1] = [ ISO_Level3_Shift ]
};
modifier_map Mod5 { ISO_Level3_Shift };
// Alphanumeric section
key <TLDE> { [ grave, asciitilde ] };
key <AE01> { [ 1, exclam ] };
key <AE02> { [ 2, at ] };
key <AE03> { [ 3, numbersign ] };
key <AE04> { [ 4, dollar ] };
key <AE05> { [ 5, percent ] };
key <AE06> { [ 6, asciicircum ] };
key <AE07> { [ 7, ampersand ] };
key <AE08> { [ 8, asterisk ] };
key <AE09> { [ 9, parenleft ] };
key <AE10> { [ 0, parenright ] };
key <AE11> { [ minus, underscore, minus ] };
key <AE12> { [ equal, plus, plus ] };
key <AD01> { [ q, Q, backslash, bar ] };
key <AD02> { [ w, W ] };
key <AD03> { [ e, E ] };
key <AD04> { [ r, R ] };
key <AD05> { [ t, T ] };
key <AD06> { [ y, Y ] };
key <AD07> { [ u, U ] };
key <AD08> {
type="MOD5_NAV",
[ i, I, Up, Up ],
actions[Group1]=[NoAction(), NoAction(), RedirectKey(key=<UP>,clearmods=ISO_Level3_Shift)]
};
key <AD09> { [ o, O ] };
key <AD10> { [ p, P ] };
key <AD11> { [ bracketleft, braceleft ] };
key <AD12> { [ bracketright, braceright ] };
key <AC01> { [ a, A ] };
key <AC02> { [ s, S ] };
key <AC03> { [ d, D ] };
key <AC04> { [ e, E ] };
key <AC05> { [ g, G ] };
key <AC06> { [ h, H ] };
key <AC07> {
type="MOD5_NAV",
[ j, J, left ],
actions[Group1]=[NoAction(), NoAction(), RedirectKey(key=<LEFT>,clearmods=ISO_Level3_Shift)]
};
key <AC08> {
type="MOD5_NAV",
[ k, K, Down, Down ],
actions[Group1]=[NoAction(), NoAction(), RedirectKey(key=<DOWN>,clearmods=ISO_Level3_Shift)]
};
key <AC09> {
type="MOD5_NAV",
[ l, L, Right, Right ],
actions[Group1]=[NoAction(), NoAction(), RedirectKey(key=<RGHT>,clearmods=ISO_Level3_Shift)]
};
key <AC10> { [ semicolon, colon ] };
key <AC11> { [ apostrophe, quotedbl ] };
key <AB01> { [ z, Z ] };
key <AB02> { [ x, X ] };
key <AB03> { [ c, C ] };
key <AB04> { [ v, V ] };
key <AB05> { [ b, B ] };
key <AB06> { [ n, N ] };
key <AB07> { [ m, M ] };
key <AB08> { [ comma, less ] };
key <AB09> { [ period, greater ] };
key <AB10> { [ slash, question ] };
key <BKSL> { [ backslash, bar ] };
};
== cut here ==
This is my /usr/share/X11/types/basic:
== cut here ==
// $Xorg: basic,v 1.3 2000/08/17 19:54:48 cpqbld Exp $
default xkb_types "basic" {
// Fairly standard definitions for
// the four required key types
virtual_modifiers NumLock, ISO_Level3_Shift;
type "ONE_LEVEL" {
modifiers = None;
map[None] = Level1;
level_name[Level1]= "Any";
};
type "TWO_LEVEL" {
modifiers = Shift;
map[Shift] = Level2;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
};
type "ALPHABETIC" {
modifiers = Shift+Lock;
map[Shift] = Level2;
map[Lock] = Level2;
level_name[Level1] = "Base";
level_name[Level2] = "Caps";
};
type "MOD5_NAV" {
modifiers = Shift+Mod5;
map[None] = level1;
map[Shift] = level2;
map[Mod5] = level3;
map[Mod5+Shift] = level3;
level_name[Level1] = "Base";
level_name[Level2] = "Caps";
level_name[Level3] = "Arrows";
};
};
== cut here ==
The keymap is loaded with:
$ setxkbmap "mag(mag)"
The system thinks the configuration is:
$ setxkbmap -print
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+mag(mag)
geometry: pc(pc105)
Many thanks for any help!
Michael
--
Michael Graham <magog at the-wire.com>
More information about the xorg
mailing list