[maemo-developers] xkb problem with generating unshifted left and right arrows
From: Michael Graham magog at the-wire.comDate: Mon Nov 3 04:00:45 EET 2008
- Previous message: Projects Nokia should support (yours?)
- Next message: Maemo Bug Jar #29
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've been using a non-standard keyboard layout for awhile now, mapping
the cursors to CAPS+I/J/K/L. It's kind of like the inverted T
cursors, but on the home row.
I've had this layout working in my Ubuntu laptop for some time, and I'm
trying to get it to work on my n810, using either my bluetooth or USB
keyboard.
I'm no xkb expert - I've just cobbled together the resources out there
and used some trial and error to get the layout working.
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+I moves the cursor up a line, but CAPS+J does nothing.
However, the shifted forms of all four keys do work properly. For
instance, when using the Notes application, while CAPS+J does nothing,
CAPS+SHIFT+J extends the selection to the left.
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 also tried remapping Left and Right to different letters on the
keyboard so it's not something special with the J and K keys.
I've tested this with two bluetooth keyboards (one HID, one SPP) and a
USB keyboard. The same USB keyboard works correctly with this mapping
on my Ubuntu laptop but not on my n810. So I don't believe it's
hardware related.
Any xkb hackers out there? Help!!
This is my /usr/share/X11/types/mag:
default xkb_types "mag" {
virtual_modifiers ISO_Level3_Shift;
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";
};
};
=================================
This is my /usr/share/X11/symbols/mag:
partial alphanumeric_keys modifier_keys
xkb_symbols "mag" {
name[Group1]= "U.S. English - with home-row cursor keys";
// CAPSLOCK is a mode switch key to level3
key <CAPS> {
symbols[Group1] = [ ISO_Level3_Shift ],
[ 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> { [ f, F ] };
key <AC05> { [ g, G ] };
key <AC06> { [ h, H ] };
key <AC07> {
type="MOD5_NAV",
[ j, J, Left, 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 ] };
};
=================================
The keymap is loaded with:
$ setxkbmap mag
The main reference for figuring this stuff out was here:
http://osdir.com/ml/xfree86.internationalization/2004-04/msg00010.html
Although, this guy uses a Dvorak layout and uses Alt instead of CAPS
to do the mode switching.
Many thanks!
Michael
--
Michael Graham <magog at the-wire.com>
- Previous message: Projects Nokia should support (yours?)
- Next message: Maemo Bug Jar #29
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
