XKB - remap arrow keys and preserve shift behaviour to select text

Posted by dgirardi on Super User See other posts from Super User or by dgirardi
Published on 2012-11-02T22:22:38Z Indexed on 2012/11/02 23:05 UTC
Read the original article Hit count: 267

Filed under:
|
|

I realize arrow key remapping is an old problem, however I cannot seem to find a good solution that lets me select text with SHIFT + remapped keys as I would do with the vanilla arrow keys.

For instance, if I remap Caps Lock to ISO_Level3_Shift and set xkb_symbols to read either

key <AC08>  { [         k,          K , Down, Down] };

or

key <AC08>  { type="THREE_LEVEL",
              [         k,          K , Down ]  };

Pressing Shift+CapsLock+K will behave exactly as CapsLock+K (while Shift+Down behaves differently from Down alone).

I had somewhat more success using higher level macro utilities and generating keyboard events (i.e. generate both the shift and the arrow keypresses); hoever that approach has a whole set of different problems - often the UI response to a simulated keypress is different from the "real" keypress, and there are performance problems as well - I can type faster than the thing can handle.

Tl;dr; how can you shift-select using remapped arrow keys under X?

© Super User or respective owner

Related posts about remapping

  • Remapping the Windows key in Parallels

    as seen on Super User - Search for 'Super User'
    I'm running XP on Parallels 4 for Mac, and it's working well enough, however one thing that's bothering me more and more as I go along is the way it constantly assumes every press of the command key means I want the start menu to come up. I've tried to remap it in the Parallels preferences, but all… >>> More

  • Dvorak hotkey remapping in vim, worth it?

    as seen on Super User - Search for 'Super User'
    I've been trying to learn the dvorak keyboard layout of late and I have been making some good progress this time around. The trouble I am finding now is that all of my hotkeys are all in the wrong places. As a vim user this is particularly troubling. I have found good resources to switch the bindings… >>> More

  • Apple keyboard key remapping under Ubuntu

    as seen on Super User - Search for 'Super User'
    I have an Apple keyboard that I simply love. I now hate my regular keyboard at work. I just have a small problem with the Apple keyboard. There is no "insert" key. The one that is usually Insert on regualr keyboard is replaced by the "fn" key. I would like to keep the fn functionality, as it is useful… >>> More

  • Selective Pointer device remapping in linux

    as seen on Super User - Search for 'Super User'
    I just got an HP 2710p (hp tablet, with digitizer), and I've played around with linux for a while now, and thought I would go ahead and install it. Everything works fine, excepting normal tablet functions, which is to be expected. I'm working on the screen rotation, and there are on-screen keyboards… >>> More

  • WPF Keyboard Remapping

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Hello, I am trying to remap the input of a textbox. For example. If a user enters a N then I would like to change it to a 9. I thought it might be best to try and catch it in the PreviewKeyDown event although I will also need to process paste attempts (I can solve that bit I think). Is PreviewKeyDown… >>> More

Related posts about xkb