将一个组合键重新映射到另一个组合,例如 Super+Ctrl+Shift+J -> Ctrl+Shift+Left

lol*_*lov 13 keyboard keyboard-layout shortcut-keys xmodmap xkb

我想实现一个附加键层,这样我就可以访问非字母数字键而不必移动我的手腕。

为此,我一直在使用 Autokey,但体验并不令人满意:它偶尔会出现延迟,并且让原始击键进入某些应用程序。

所以我需要一个低级的解决方案。

小智 12

尝试结合使用xbindkeysxvkbdxbindkeys侦听密钥并将翻译发送到 xvkbd。

sudo apt-get install xbindkeys xvkbd
xbindkeys --defaults > ~/.xbindkeysrc
Run Code Online (Sandbox Code Playgroud)

.xbindkeysrc在您喜欢的编辑器中打开。我将其他所有内容都注释掉了,但如果需要,最好参考一下。

为了检查一下,我尝试映射Ctrl+;到Ctrl+V

"xvkbd -xsendevent -text "\Cv""
   control + semicolon
Run Code Online (Sandbox Code Playgroud)

我希望你在追求这样的事情

"xvkbd -xsendevent -text "\C\S\[Left]""
  Super+Control+Shift+J
Run Code Online (Sandbox Code Playgroud)

保存文件,然后运行xbindkeys

为了重新加载任何配置更改,我终止了该xbindkeys进程然后重新启动。

xbindkeys 语法

我通过使用 GUI 计算出组合键 xbindkeys

sudo apt-get install xbindkeys-config
xbindkeys-config
Run Code Online (Sandbox Code Playgroud)

运行后,按 Get Key 将组合放入.xbindkeysrc文件的第二行。

xvkbd 语法

从手册:

\r - Return
\t - Tab
\b - Backspace
\e - Escape
\d - Delete
\S - Shift (modify the next character; please note that modify with ``\S'' will be ignored in many cases. For example, ``a\Cb\ScD\CE'' will be interpreted as a, Control-b, c, Shift-D, and Control-Shift-E.)
\C - Control (modify the next character)
\A - Alt (modify the next character)
\M - Meta (modify the next character)
\[keysym] - the keysym keysym (e.g., \[Left]), which will be processed in the similar matter with other general characters
\{keysym} - the keysym keysym (e.g., \{Left}), which will be processed in more primitive matter and can also be used for modofier keys such as Control_L, Meta_L, etc.; also, \{+keysym} and \{+keysym} will simulate press and release of the key, respectively [Version 3.3]
\Ddigit - delay digit * 100 ms
\xvalue - move mouse pointer (use "+" or "-" for relative motion)
\yvalue - move mouse pointer (use "+" or "-" for relative motion)
\mdigit - simulate click of the specified mouse button
Run Code Online (Sandbox Code Playgroud)

喜欢听听它是如何工作的,以及这种组合是否适合您的目的。它作为键盘映射器看起来不错,但不一定是宏运行器。


mat*_*b89 0

我想你可以在这里找到解决方案(因为 Xorg 是最底层......): https: //wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg

编辑:据我所知,您需要lv3:win_switch在 .conf 文件中添加该选项

  • [*清喉咙*](http://meta.askubuntu.com/questions/15151/please-do-not-use-links-as-entire-answers) ***;)*** (7认同)