CMD & control keys swap in ubuntu

后端 未结 6 1803
生来不讨喜
生来不讨喜 2021-02-02 02:09

I have an Apple keyboard with a cmd key which I\'m trying to swap with the control key.

From googleing the problem and searching across the forum I came with a several s

6条回答
  •  暖寄归人
    2021-02-02 02:16

    EDIT: Just realized that this post was from six months ago. I doubt this will be any help, as you've probably (hopefully!) already gotten this solved, but, whatever.

    Here's what you need to do:

    Add the following to your ~/.Xmodmap file:

    clear control
    clear mod4
    
    keycode 105 =
    keycode 206 =
    
    keycode 133 = Control_L NoSymbol Control_L
    keycode 134 = Control_R NoSymbol Control_R
    keycode 37 = Super_L NoSymbol Super_L
    
    add control = Control_L
    add control = Control_R
    add mod4 = Super_L
    

    To test this right now, just do xmodmap ~/.Xmodmap

    Now, to have this happen every time at startup, add to the end of your (and/or create a new) ~/.xinitrc file the following:

    xmodmap /home/your_username/.Xmodmap

    Now restart / logout / restart X and you should be swell! Any trouble, please comment.

提交回复
热议问题