5

How I can change Alt+symbol to some other ?

For example,

I changed semi-colon like this:

keycode 47   = BackSpace colon semicolon colon semicolon colon

But I want Alt+; to produce ;.

Yuki
  • 233

1 Answers1

4

Keep in mind that xmodmap is sort of deprecated, and will have problems --- for example, the keyboard is re-set on each layout change (that sometime happens when you didn't even think); the file ~/.Xmodmap can be loaded or not depending on your Desktop and DM (display manager). You see more detailed info in this answer and a more "modern" way of making the change in this blog post by myself.

Nevertheless, if you have just one layout maybe xmodmap can work for you, as it seems from your post... so:

  1. Find the keycode of your "+" key; for example, in my laptop with US intl keyboard:

    [:~] % xmodmap -pke | grep plus     
    keycode  21 = equal plus equal plus multiply division
    keycode 126 = plusminus NoSymbol plusminus
    

xmodmap -pke will dump your full keyboard map, and the grep is there to filter just the keys that define "+", which is called "plus" in this case (and I have it on shift-=).

  1. To have a colon on AltGr++, you can feed to xmodmap the line:

     keycode  21 = equal plus equal plus semicolon colon
    

This will use as a modifier the keys which is defined as AltGr in your keyboard layout. In my keyboard it is the Right-Alt key, but YMMV.

Rmano
  • 31,947
  • I am more interested about usual Alt (left one). I want to have every Alt_L combinations to work as usual on the system, except some specified with xmodmap. I will be pretty happy to have solution with another tool. And yes, I am annoyed by reset behavior of xmodmap. – Yuki May 12 '14 at 03:21
  • Normally Alt_L is not a shift --- it is not used to create characters, it is a modifier and normally intercepted by applications. Now, I know it should be possible to define it as you like with the XKB system, but... read the first quote on http://www.charvolant.org/~doug/xkb/html/xkb.html ;-| – Rmano May 12 '14 at 03:37
  • Unfortunately, all documentation I see is useless for the end-use. I cannot find solutions for my problem. I don't have time for experiments. Thank you)). – Yuki May 12 '14 at 05:34