CMD &在 ubuntu 中交换控制键 [英] CMD & control keys swap in ubuntu

查看:25
本文介绍了CMD &在 ubuntu 中交换控制键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 cmd 键的 Apple 键盘,我正试图将其与控制键交换.

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

通过谷歌搜索问题并在论坛中搜索,我找到了几个解决方案.不幸的是,他们都没有为我工作.我试过使用标准的键盘布局",Xmodmap &无论我遇到什么.我得到的最接近的是交换它们但禁用箭头键.

From googleing the problem and searching across the forum I came with a several solutions. Unfortunately none of them worked for me. I've tried using the standard "Keyboard layout", Xmodmap & whatever I came across. The closest I got is swaping them but disabling the arrow keys.

我使用的是 ubuntu 11.

I'm using ubuntu 11.

希望有人能帮助我.先感谢您.

Hope someone can help me. Thank you in advance.

这是我的 xmodmap 结果:

This is my xmodmap result:

    shift       Shift_L (0x32),  Shift_R (0x3e)
    lock        Caps_Lock (0x42)
    control     Control_L (0x25),  Control_R (0x69)
    mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
    mod2        Num_Lock (0x4d)
    mod3      
    mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
    mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

我希望控件为 mod4,反之亦然.谢谢..

I want the control to be mod4 and vice versa. Thanks..

推荐答案

刚刚意识到这篇文章是六个月前的.我怀疑这会有所帮助,因为您可能(希望!)已经解决了这个问题,但是,无论如何.

以下是您需要做的:

将以下内容添加到您的 ~/.Xmodmap 文件中:

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

要立即测试,只需执行 xmodmap ~/.Xmodmap

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

现在,要在每次启动时都发生这种情况,请将以下内容添加到(和/或创建新的)~/.xinitrc 文件的末尾:

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

现在重启/注销/重启X,你应该膨胀了!有什么问题请评论.

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

这篇关于CMD &在 ubuntu 中交换控制键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆