3

I would like to remap some common symbols like ( and ) to the base line of my keyboard combining Alt Gr with other keys like j or k.

I can remap Alt Gr+k to ) because that combination prints ĸ. The problem with Alt Gr+j is that combination is the dead key "hook above", so I can't remap the symbol.

I don't want to modify the Xorg config/files because I want a portable config between different computers. I'm only interested in the config for the text editors.

The output of xev for the keys combination is:

KeyPress event, serial 40, synthetic NO, window 0x5e00001,
    root 0x39a, subw 0x0, time 15760149, (170,-16), root:(170,36),
    state 0x10, keycode 66 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x5e00001,
    root 0x39a, subw 0x0, time 15760673, (170,-16), root:(170,36),
    state 0x90, keycode 44 (keysym 0xfe61, dead_hook), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: True

KeyRelease event, serial 40, synthetic NO, window 0x5e00001,
    root 0x39a, subw 0x0, time 15760753, (170,-16), root:(170,36),
    state 0x90, keycode 44 (keysym 0xfe61, dead_hook), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x5e00001,
    root 0x39a, subw 0x0, time 15761115, (170,-16), root:(170,36),
    state 0x90, keycode 66 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

I'm using setxkbmap -layout "es" -option "lv3:caps_switch" to configure the keyboard.

For Emacs:

(define-key key-translation-map (kbd "ĸ") (kbd ")"))

For Vim:

imap ĸ )

Any help is welcome.

  • Are you running GVim or Vim in a terminal? If a terminal, which terminal emulator? What graphical toolkit is the Emacs binary built against (if you don't know: which package of what distribution are you using)? – Gilles Dec 16 '15 at 22:58
  • Emacs built against GTK3 and GVim. The distro is Arch Linux. – Rufo El Magufo Dec 18 '15 at 0:45

Your Answer

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

Browse other questions tagged or ask your own question.