如何在 Linux 中将键盘输出更改为对角线箭头? (↖↗↘↙)

How can I change keyboard output to diagonal arrows in Linux? (↖↗↘↙)

(我是 运行 Linux 薄荷 17)

使用xmodmap,我想让我的键盘输入字符↖ ↗ ↘ ↙

上下左右箭头(↑ ← ↓ →)我已经知道了,比如这个向上箭头的例子:

xmodmap -e "keycode  25 = uparrow w w W aring Aring aring"

使用代码 0x8fc 代替名称 uparrow 也可以:

xmodmap -e "keycode  25 = 0x8fc w w W aring Aring aring"

也许不是(参见 How to map a X11 KeySym to a Unicode character?,缺少一些细节:

在您的示例中,0x8fc 是一个十六进制 keysym 值。 "normal" 箭头是这些:

0x08fb     U2190  # leftarrow
0x08fc     U2191  # uparrow
0x08fd     U2192  # rightarrow
0x08fe     U2193  # downarrow

有几个地方可以找到带有对角箭头的列表(this for instance), which usually use the "Uxxxx" form. However, you may notice that the hexadecimal value does not match. That is because it refers to the X keysym (key-symbol) values, which generally are defined in /usr/include/X11/keysymdef.h (which has no definitions for diagonal arrows). xmodmap 可以扩展以更加了解 Xkb,但快速检查似乎没有找到任何提及此内容的地方。

OP 的解决方案。

我是这样工作的:

xmodmap -e "keycode 107 = U2196"  #↖

对于 unicode 字符,我需要将“0x”改为 "U"

而不是 0x2196