2

I would like to use ctrl + h as Left Arrow and so on (vim style) in whole OS (all apps). I use gnome 3.16.4.

xev result for ctrl+h press-release sequence is:

KeyPress event, serial 37, synthetic NO, window 0x3000001,
    root 0xf6, subw 0x0, time 8058713, (-860,225), root:(166,344),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x3000001,
    root 0xf6, subw 0x0, time 8058895, (-860,225), root:(166,344),
    state 0x4, keycode 43 (keysym 0x68, h), same_screen YES,
    XLookupString gives 1 bytes: (08) "
    XmbLookupString gives 1 bytes: (08) "
    XFilterEvent returns: False

KeyRelease event (...)

and for h one line is as follows:

XLookupString gives 1 bytes: (68) "h"

Left arrow is simple:

keycode 113 (keysym 0xff51, Left)

Actualization

Rationale for CTRL

Firstly I wanted assign fn + h,j,k,l but it seems to be imposible in software way. windows + l and windows + h are also in use as logout and minimal window respectively. Left Alt looks like the best option, but in some programs it works as additional letters (encoding) (e.g. vim and gvim see distinct keys when alt is pressed).

I know that I will lost some functionality using ctrl, but so far I've never use default ctrl + hjkl shortcuts in a terminal (I use vi-mode mapping set in .inputrc)

xev Alt + h version:

KeyPress event, serial 37, synthetic NO, window 0x1e00001,
    root 0xf6, subw 0x0, time 2180657, (434,71), root:(484,158),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x1e00001,
    root 0xf6, subw 0x0, time 2180851, (434,71), root:(484,158),
    state 0x8, keycode 43 (keysym 0x68, h), same_screen YES,
    XLookupString gives 1 bytes: (68) "h"
    XmbLookupString gives 1 bytes: (68) "h"
    XFilterEvent returns: False
1

Control H, J, L already have well-established uses in terminals:

  • controlH for erase (except Linux)
  • controlJ is newline
  • controlL is a form-feed equated with clearing the screen

In bash, controlK is by default bound to kill-line.

It is possible to change these assignments, but your computer would be less useful thereafter.

  • 1
    Hi. Firstly I wanted assign "fn"+hjkl but it seems to imposible in software way. "windows" + l is also logout shorcut. Left Alt seems good enough but in some programs it works as additional letters (encoding). I know that I will lost some functionality using ctrl, but so far I've never use shortcuts you've written. For clear screen I have alias "c" in bashrc. For newline I use ENTER For erase - BACKSPACE Could you please write a tip to do it using CTRL or ALT? – Mesco Sep 6 '16 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.