AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 494734
Accepted
user84207
user84207
Asked: 2019-01-16 21:34:51 +0800 CST2019-01-16 21:34:51 +0800 CST 2019-01-16 21:34:51 +0800 CST

将非修饰符配置为修饰键

  • 772

这个问题类似于:

https://askubuntu.com/questions/33751/making-any-key-into-a-modifier-key

我有一台具有非标准键盘布局(联想 x1 carbon)的机器,其中 CapsLock 键已被 Home、End 取代。我习惯将 CapsLock 映射为控件,所以我使用 xmodmap 来映射 Home,End 到 Control:

xmodmap -e 'keycode 110 = Control_L' # Home
xmodmap -e 'keycode 115 = Control_L' # End

当我单独按 Home(或 End)时,会检测到正确的键符:

state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,

但我不能使用重新映射的 Home 或 End 键作为任何其他键的修饰符:当我按 Control+a 时,a 键不会被修改:

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157752, (829,406), root:(830,407),
    state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157761, (829,406), root:(830,407),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XmbLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157912, (829,406), root:(830,407),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157949, (829,406), root:(830,407),
    state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

而如果我使用“真实”控制键,则“a”键按下具有控制修饰符状态:

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15160488, (829,406), root:(830,407),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161477, (829,406), root:(830,407),
    state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (01) ""
    XmbLookupString gives 1 bytes: (01) ""
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161588, (829,406), root:(830,407),
    state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (01) ""
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161842, (829,406), root:(830,407),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

在我的情况下,是否可以将 Home 键配置为 Control 修饰键?还是有一些硬件限制阻止了这一点?

keyboard-layout xmodmap
  • 1 1 个回答
  • 85 Views

1 个回答

  • Voted
  1. Best Answer
    Andra
    2019-01-22T10:27:34+08:002019-01-22T10:27:34+08:00

    除了您的两个命令之外,您还必须添加 Control:
    xmodmap -e 'keycode 110 = Control_L' # Home
    xmodmap -e 'keycode 115 = Control_L' # End
    xmodmap -e 'add Control = Control_L'

    • 0

相关问题

  • 如何在 US-Intl 布局上键入法文引号?[复制]

  • 将 Escape 键变成一个修饰符,在点击时仍充当 Escape

  • 如何撤消“setxkbmap pc”

  • 回弹 shift 键仍充当 shift 键

  • 将波浪号和横杠堆叠在字母上

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve