Sunday, April 28, 2024
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 11769  / 1 Year ago, mon, november 21, 2022, 10:41:51

Although there are lots of different articles how to change the left Alt to simulate win , I want to map the right Alt to do so. I want to move to 11.10, I fall back to unity 2d and dont have a win key. I kennot even get the keycode in the articles I found...
Any help or good suggestions?


More From » shortcut-keys

 Answers
3

You can use xmodmap to remap any
key on the keyboard; in particular, you can remap the right Alt to
act as a Super/Win key.



Create a file named .Xmodmap in your home directory with the
following content:



! free up right-Alt for remapping
remove mod1 = Alt_R

! Right-Alt remapped to Super
clear mod4
keycode 108 = Super_R
add mod4 = Super_R


When you log out and then log in again, GNOME should ask you if you
want to load the .Xmodmap file; answer "yes" and you're ready to
go. (You will only asked once.)



Alternatively, you can load the .Xmodmap configuration from a
terminal at any time:



xmodmap .Xmodmap


There are a few things that can vary depending on the X server version and keyboard model. The following items could help you adapt the .Xmodmap file to your specific environment.




  1. Check that your right Alt key is initially on mod1: Issue the command
    xmodmap in a terminal window, and you should get an output like
    this one:



    xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):

    shift Shift_L (0x32), Shift_R (0x3e)
    lock Caps_Lock (0x9), Caps_Lock (0x4e)
    control Control_L (0x25), Control_R (0x69)
    mod1 Alt_L (0x40), Alt_R (0x6c), Alt_L (0xcc)
    mod2
    mod3 Mode_switch (0xcb)
    mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce)
    mod5


    If the Alt_R tag does not appear in the mod1 line but on a
    different one, adjust your .Xmodmap accordingly.


  2. Check that your right Alt key is keycode 108: in a terminal window,
    type the command xev, then focus
    the small square window that popped up. If you type the right
    Alt
    key there, you should see lines appearing in the terminal
    window. Look for a stanza like this one:



    KeyPress event, serial 25, synthetic NO, window 0x5000001,
    root 0xbd, subw 0x5000002, time 867397196, (53,48), root:(54,49),
    state 0x0, keycode 108 (keysym 0xffea, Alt_R), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False


    The number after the keycode word is the one you want in your
    .Xmodmap file for remapping right Alt.



[#42665] Wednesday, November 23, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
whoppinolo

Total Points: 93
Total Questions: 113
Total Answers: 107

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
whoppinolo questions
Tue, Feb 14, 23, 08:30, 1 Year ago
Wed, Sep 28, 22, 06:56, 2 Years ago
Fri, May 27, 22, 01:55, 2 Years ago
Tue, Oct 12, 21, 09:33, 3 Years ago
;