• You are not logged in.

    xkb double keys

    • Started by innovine
    • 6 Replies:
    • Reputation: 0
    • Registered: 24-Feb-2011
    • Posts: 40

    I'm struggling to get xkb set up the way I want to. Currently I want to have two RALT keys available, and move LALT to WIN. I've managed to change the keycodes/xfree86 file to move keys around, but I can't seem to make a duplicate. My typematrix keyboard generates keycodes 115, 64, 113. (win, lalt and ralt from left to right normally). I'd like to change this to lalt, ralt, ralt.. I don't need the win key but my ralt modifier should be available on both hands...

    my keycodes/xfree86 file contains:
    <LALT> = 115;
    <RALT> = 64;
    <RALT> = 113;

    Unfortunately only one RALT gets used. I've also tried:
    <LALT> = 115;
    <RALT> = 64;
    <BLAH> = 113;
    alias <BLAH> = <RALT>;

    but this didn't work either. Any tips or suggestions would be really welcome. If there is a good resource showing how to set up modifiers and virtual modifiers and how these work with the symbol files then that would be really sweet too, but I've been googling and think I've seen the majority of the info already... I'm content if I can get an ugly hack to duplicate the key..

    Offline
    • 0
    • Reputation: 0
    • Registered: 24-Feb-2011
    • Posts: 40

    I sort of figured out a way to do this...
    xmodmap -e "keycode 113 = ISO_Level3_Shift"

    I feel a bit uneasy using both xmodmap and xkb together, but it's at least working now. Fully understanding these modifiers and shift levels would really open up some doors for cool tricks.

    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,362

    The problem with your first attempt is that you're assigning an alias ('<RALT>') first to one value (64) and then changing it to another (113). That won't do.

    Not entirely sure, but I think you want to add a line to your rules file that tells xkb that the <LALT> key should act as a lvl3 shift modifier.

    There are various reads out there on the tricky topic of xkb, such as http://www.xfree86.org/current/XKB-Enhancing.pdf

    Last edited by DreymaR (03-Mar-2011 18:46:34)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 03-Jul-2009
    • Posts: 189

    Don't waste your time with XKB.  It's the most cumbersome package I've ever dealt with.  Just use it to remap alphanumeric and symbols keys.  To remap modifiers, resort to xmodmap.  Then make sure your X session calls xmodmap upon initialization.  And that's it.

    Dvorak typist here.  Please take my comments with a grain of salt.

    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,362

    I thought xmodmap was an older way of doing things, and practically on its way out? Then again, I'm not sure what I based that belief on, hehe. It does seem a lot simpler - but other than that, what are the politics?

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 23
    • From: Belgium
    • Registered: 26-Feb-2008
    • Posts: 482

    xkb and xmodmap are two ways to drive the same car; namely to modify the X11 server's internal key mappings.  xkb is typically used to remap entire layouts, vs. xmodmap more for individual keys.  But neither is "better" or more efficient.

    You are not, as with PKL on Windows, running an additional layer that intercepts and translates keystrokes before they go to the lower-level drivers.

    Last edited by ghen (07-Jun-2011 09:33:07)
    Offline
    • 0
    • Reputation: 0
    • Registered: 03-Jul-2009
    • Posts: 189
    DreymaR said:

    I thought xmodmap was an older way of doing things, and practically on its way out? Then again, I'm not sure what I based that belief on, hehe. It does seem a lot simpler - but other than that, what are the politics?

    Exactly, Xmodmap is considered obsolete, but it's *easy* and *works*.  I have spent hours trying to remap my modifiers, nothing ever worked reliably.  With Xmodmap I have spent very little time beside that needed to write down the keycodes by running "xev".  Only downside is it does not work for your login screen, that's the reason I have suggested using XKB for symbols and Xmodmap for modifiers.

    My bet is that Xmodmap is going to stay.

    Dvorak typist here.  Please take my comments with a grain of salt.

    Offline
    • 0