Active Topics

 


Reply
Thread Tools
Posts: 41 | Thanked: 18 times | Joined on Jun 2008 @ Toronto
#1
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.

I've had this working in Ubuntu for awhile, and I'm trying to get it to work on my n810 with my bluetooth 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+J does nothing, but CAPS+I moves the cursor up a line.

The shifted forms of all four keys work fine. In other words, holding down 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 tried two bluetooth keyboards. One HID, one SPP. I've also tried remapping to different letters on the keyboard so it's not something special with the J and K keys.

Any xkb hackers out there? Help!!


This is my /usr/share/X11/symbols/mag
Code:
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 ]
    };
    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	]	};
 
};
This is my /usr/share/X11/types/basic
Code:
// $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";
    };
};
The keymap is loaded with:
Code:
    $ setxkbmap "mag(mag)"
The main reference for figuring this stuff out was here:
http://osdir.com/ml/xfree86.internat.../msg00010.html. Although, this guy uses a Dvorak layout and uses Alt instead of CAPS to do the mode switching.

Many thanks!


Michael
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:31.