使用 Compose 键编写“dead_greek”

使用 Compose 键编写“dead_greek”

我的撰写键的配置文件/usr/share/X11/locale/en_US.UTF-8/Compose列出了撰写希腊字母的所有按键序列;所有这些按键序列都需要按下一个特殊dead_greek按键。这当然不是物理按键,那么,我如何才能将任意按键序列分配给我的撰写键以产生这个虚拟的dead_greek

此外,我很想知道您是否找到了一种舒适的键盘配置,包括一般的撰写键,特别是希腊字母。

答案1

为了帮助在这里遇到困难的人,

您需要配置~/.XCompose(请参阅下面的完整文件)并重新启动 X 会话

要在拉丁键盘上输入希腊字母:

  1. 按住撰写键 — — 通常它是正确的Alt(在“系统设置”中的“键盘”部分中查找“撰写键位置”)。<Multi_key>在下面的列表中。
  2. 键入g小写字母或G大写字母。G 代表“G为方便起见,使用不同的大写字母
  3. 键入等效的拉丁字母。
  4. 松开撰写键。

您可以在文件中看到系统范围内配置的组合序列列表/usr/share/X11/locale/$LANG/Compose,其中$LANG是当前语言环境的环境变量(对于美国英语,它等于en_US.UTF-8):

$ cd /usr/share/X11/locale/$LANG/
$ less Compose

要启用希腊字母书写功能,请将以下内容添加到您的~/.XCompose文件中:

~/.XCompose
# GREEK CAPITAL LETTERS
<Multi_key> <G> <A> : "Α"    U0391    # GREEK CAPITAL LETTER ALPHA
<Multi_key> <G> <B> : "Β"    U0392    # GREEK CAPITAL LETTER BETA
<Multi_key> <G> <G> : "Γ"    U0393    # GREEK CAPITAL LETTER GAMMA
<Multi_key> <G> <D> : "Δ"    U0394    # GREEK CAPITAL LETTER DELTA
<Multi_key> <G> <E> : "Ε"    U0395    # GREEK CAPITAL LETTER EPSILON
<Multi_key> <G> <Z> : "Ζ"    U0396    # GREEK CAPITAL LETTER ZETA
<Multi_key> <G> <H> : "Η"    U0397    # GREEK CAPITAL LETTER ETA
<Multi_key> <G> <I> : "Ι"    U0399    # GREEK CAPITAL LETTER IOTA
<Multi_key> <G> <K> : "Κ"    U039A    # GREEK CAPITAL LETTER KAPPA
<Multi_key> <G> <L> : "Λ"    U039B    # GREEK CAPITAL LETTER LAMDA
<Multi_key> <G> <M> : "Μ"    U039C    # GREEK CAPITAL LETTER MU
<Multi_key> <G> <N> : "Ν"    U039D    # GREEK CAPITAL LETTER NU
<Multi_key> <G> <P> : "Π"    U03A0    # GREEK CAPITAL LETTER PI
<Multi_key> <G> <R> : "Ρ"    U03A1    # GREEK CAPITAL LETTER RHO
<Multi_key> <G> <S> : "Σ"    U03A3    # GREEK CAPITAL LETTER SIGMA
<Multi_key> <G> <T> : "Τ"    U03A4    # GREEK CAPITAL LETTER TAU
<Multi_key> <G> <U> : "Υ"    U03A5    # GREEK CAPITAL LETTER UPSILON
<Multi_key> <G> <F> : "Φ"    U03A6    # GREEK CAPITAL LETTER PHI
<Multi_key> <G> <X> : "Χ"    U03A7    # GREEK CAPITAL LETTER CHI
<Multi_key> <G> <O> : "Ω"    U03A9    # GREEK CAPITAL LETTER OMEGA

# DOUBLES (additional stroke <Q>)
<Multi_key> <G> <Q> <T> : "Θ"    U0398    # GREEK CAPITAL LETTER THETA
<Multi_key> <G> <Q> <O> : "Ο"    U039F    # GREEK CAPITAL LETTER OMICRON
<Multi_key> <G> <Q> <X> : "Ξ"    U039E    # GREEK CAPITAL LETTER XI
<Multi_key> <G> <Q> <P> : "Ψ"    U03A8    # GREEK CAPITAL LETTER PSI

# greek small letters
<Multi_key> <g> <a> : "α"    U03B1    # GREEK SMALL LETTER ALPHA
<Multi_key> <g> <b> : "β"    U03B2    # GREEK SMALL LETTER BETA
<Multi_key> <g> <g> : "γ"    U03B3    # GREEK SMALL LETTER GAMMA
<Multi_key> <g> <d> : "δ"    U03B4    # GREEK SMALL LETTER DELTA
<Multi_key> <g> <e> : "ε"    U03B5    # GREEK SMALL LETTER EPSILON
<Multi_key> <g> <z> : "ζ"    U03B6    # GREEK SMALL LETTER ZETA
<Multi_key> <g> <h> : "η"    U03B7    # GREEK SMALL LETTER ETA
<Multi_key> <g> <i> : "ι"    U03B9    # GREEK SMALL LETTER IOTA
<Multi_key> <g> <k> : "κ"    U03BA    # GREEK SMALL LETTER KAPPA
<Multi_key> <g> <l> : "λ"    U03BB    # GREEK SMALL LETTER LAMDA
<Multi_key> <g> <m> : "μ"    U03BC    # GREEK SMALL LETTER MU
<Multi_key> <g> <n> : "ν"    U03BD    # GREEK SMALL LETTER NU
<Multi_key> <g> <p> : "π"    U03C0    # GREEK SMALL LETTER PI
<Multi_key> <g> <r> : "ρ"    U03C1    # GREEK SMALL LETTER RHO
<Multi_key> <g> <s> : "σ"    U03C3    # GREEK SMALL LETTER SIGMA
<Multi_key> <g> <t> : "τ"    U03C4    # GREEK SMALL LETTER TAU
<Multi_key> <g> <u> : "υ"    U03C5    # GREEK SMALL LETTER UPSILON
<Multi_key> <g> <f> : "φ"    U03C6    # GREEK SMALL LETTER PHI
<Multi_key> <g> <x> : "χ"    U03C7    # GREEK SMALL LETTER CHI
<Multi_key> <g> <o> : "ω"    U03C9    # GREEK SMALL LETTER OMEGA

# doubles (additional stroke <q>)
<Multi_key> <g> <q> <t> : "θ"    U03B8    # GREEK SMALL LETTER THETA
<Multi_key> <g> <q> <o> : "ο"    U03BF    # GREEK SMALL LETTER OMICRON
<Multi_key> <g> <q> <p> : "ψ"    U03C8    # GREEK SMALL LETTER PSI
<Multi_key> <g> <q> <s> : "ς"    U03C2    # GREEK SMALL LETTER FINAL SIGMA
<Multi_key> <g> <q> <x> : "ξ"    U03BE    # GREEK SMALL LETTER XI

也可以看看:

最常用的字母也可以设置单独的组合键。例如π

<Multi_key> <p> <i> : "π"    U03C0    # GREEK SMALL LETTER PI

您还可以将此列表保存在名为的文件中GreekCompose,并使用include命令~/.XCompose

include "%L"
include "/path/to/GreekCompose"

上面的列表是通过手动调整小型 Python 脚本的输出创建的:https://github.com/rybak/scripts/blob/master/extra/gen_x_compose.py

答案2

xmodmap -pke | grep dead_greek

如果没有输出,则表示您没有代表的键dead_greek

您可以指定一个。例如,我刚刚将右 Alt 键分配给dead_greek

xmodmap -e 'keycode 108 = dead_greek Meta_R Alt_R Meta_R'

现在我可以打字了rAlt a rAlt b rAlt g,而且输出为αβγ

答案3

也许不是一个完美的解决方案,但我用过

xmodmap -e "keycode 191 = dead_greek dead_greek dead_greek dead_greek"

这将F13键盘上的键映射到 dead_greek(四次重复代表SHIFTALTGR与 的不同组合F13)。数字191来自查看xev | sed -ne '/^KeyPress/,/^$/p'按下 时的输出F13(它显示keycode 191)。

答案4

我已经进行过实验并且想出了(在我看来)更加用户友好的绑定。

  • <g>所有希腊字母,无论是大写还是小写,都以 为前缀。
  • 在前缀之后,开始用英文输入字母的名称:例如“χ”的字母名称为“chi”。(这通常是一个字符,但有时是两个字符。)
    • 此规则有两个例外:eta 'η' 为 'h',omega 'ω' 为 'w'。这是为了避免需要输入三个字符来区分 omega 和 omicron;对于 eta,它显然是 'h' 的祖先,此外,它的开头 'e' 会与数学和科学中更常用的 epsilon 相冲突。
  • 大写希腊字母的插入方式如上所述,但要输入大写字母或至少首字母大写。
  • 一些希腊字母具有可以按上述方式访问的变体,但使用变体前缀<g> <v>,例如<g> <v> <e>产生一个 epsilon 变体 ϵ。
  • 我删除了与拉丁大写字母同义的希腊大写字母,因为它们看起来是多余的。在哪些情况下它们的显示会有所不同?
# Greek alphabet
<Multi_key> <g> <a> :       "α"    U03B1    # GREEK SMALL LETTER ALPHA
<Multi_key> <g> <b> :       "β"    U03B2    # GREEK SMALL LETTER BETA
<Multi_key> <g> <v> <b> :   "ϐ"    U03D0    # GREEK BETA SYMBOL
<Multi_key> <g> <G> :       "Γ"    U0393    # GREEK CAPITAL LETTER GAMMA
<Multi_key> <g> <g> :       "γ"    U03B3    # GREEK SMALL LETTER GAMMA
<Multi_key> <g> <D> :       "Δ"    U0394    # GREEK CAPITAL LETTER DELTA
<Multi_key> <g> <d> :       "δ"    U03B4    # GREEK SMALL LETTER DELTA
<Multi_key> <g> <e> :       "ε"    U03B5    # GREEK SMALL LETTER EPSILON
<Multi_key> <g> <v> <e> :   "ϵ"    U03F5    # GREEK LUNATE EPSILON SYMBOL
<Multi_key> <g> <z> :       "ζ"    U03B6    # GREEK SMALL LETTER ZETA
<Multi_key> <g> <v> <H> :   "Ͱ"    U0370    # GREEK CAPITAL LETTER HETA
<Multi_key> <g> <h> :       "η"    U03B7    # GREEK SMALL LETTER ETA
<Multi_key> <g> <v> <h> :   "ͱ"    U0371    # GREEK SMALL LETTER HETA
<Multi_key> <g> <T> :       "Θ"    U0398    # GREEK CAPITAL LETTER THETA
<Multi_key> <g> <v> <T> :   "ϴ"    U03F4    # GREEK CAPITAL THETA SYMBOL
<Multi_key> <g> <t> <h> :   "θ"    U03B8    # GREEK SMALL LETTER THETA
<Multi_key> <g> <v> <t> <h> :   "ϑ"    U03D1    # GREEK THETA SYMBOL
<Multi_key> <g> <i> :       "ι"    U03B9    # GREEK SMALL LETTER IOTA
<Multi_key> <g> <k> :       "κ"    U03BA    # GREEK SMALL LETTER KAPPA
<Multi_key> <g> <v> <k> :   "ϰ"    U03F0    # GREEK KAPPA SYMBOL
<Multi_key> <g> <L> :       "Λ"    U039B    # GREEK CAPITAL LETTER LAMDA
<Multi_key> <g> <l> :       "λ"    U03BB    # GREEK SMALL LETTER LAMDA
<Multi_key> <g> <v> <l> :   "ᴧ"    U1D27    # GREEK LETTER SMALL CAPITAL LAMDA
<Multi_key> <g> <m> :       "μ"    U03BC    # GREEK SMALL LETTER MU
<Multi_key> <g> <n> :       "ν"    U03BD    # GREEK SMALL LETTER NU
<Multi_key> <g> <X> :       "Ξ"    U039E    # GREEK CAPITAL LETTER XI
<Multi_key> <g> <x> :       "ξ"    U03BE    # GREEK SMALL LETTER XI
<Multi_key> <g> <O> :       "Ο"    U039F    # GREEK CAPITAL LETTER OMICRON
<Multi_key> <g> <o> :       "ο"    U03BF    # GREEK SMALL LETTER OMICRON
<Multi_key> <g> <P> <I> :   "Π"    U03A0    # GREEK CAPITAL LETTER PI
<Multi_key> <g> <P> <i> :   "Π"    U03A0    # GREEK CAPITAL LETTER PI
<Multi_key> <g> <p> <i> :   "π"    U03C0    # GREEK SMALL LETTER PI
<Multi_key> <g> <v> <p> <i> :   "ϖ"    U03D6    # GREEK PI SYMBOL
<Multi_key> <g> <r> :       "ρ"    U03C1    # GREEK SMALL LETTER RHO
<Multi_key> <g> <S> :       "Σ"    U03A3    # GREEK CAPITAL LETTER SIGMA
<Multi_key> <g> <s> :       "σ"    U03C3    # GREEK SMALL LETTER SIGMA
<Multi_key> <g> <v> <s> :   "ς"    U03C2    # GREEK SMALL LETTER FINAL SIGMA
<Multi_key> <g> <t> <a> :   "τ"    U03C4    # GREEK SMALL LETTER TAU
<Multi_key> <g> <U> :       "Υ"    U03A5    # GREEK CAPITAL LETTER UPSILON
<Multi_key> <g> <v> <U> :   "ϒ"    U03D2    # GREEK UPSILON WITH HOOK SYMBOL 
<Multi_key> <g> <u> :       "υ"    U03C5    # GREEK SMALL LETTER UPSILON
<Multi_key> <g> <F> :       "Φ"    U03A6    # GREEK CAPITAL LETTER PHI
<Multi_key> <g> <P> <H> :   "Φ"    U03A6    # GREEK CAPITAL LETTER PHI
<Multi_key> <g> <P> <h> :   "Φ"    U03A6    # GREEK CAPITAL LETTER PHI
<Multi_key> <g> <f> :       "φ"    U03C6    # GREEK SMALL LETTER PHI
<Multi_key> <g> <p> <h> :   "φ"    U03C6    # GREEK SMALL LETTER PHI
<Multi_key> <g> <v> <p> <h> :   "ϕ"    U03D5    # GREEK PHI SYMBOL
<Multi_key> <g> <c> :       "χ"    U03C7    # GREEK SMALL LETTER CHI
<Multi_key> <g> <v> <c> :   "☧"    U2627    # CHI RHO
<Multi_key> <g> <P> <S> :   "Ψ"    U03A8    # GREEK CAPITAL LETTER PSI
<Multi_key> <g> <P> <s> :   "Ψ"    U03A8    # GREEK CAPITAL LETTER PSI
<Multi_key> <g> <p> <s> :   "ψ"    U03C8    # GREEK SMALL LETTER PSI
<Multi_key> <g> <v> <p> <s> :   "ᴪ"    U1D2A    # GREEK LETTER SMALL CAPITAL PSI
<Multi_key> <g> <W> :       "Ω"    U03A9    # GREEK CAPITAL LETTER OMEGA
<Multi_key> <g> <w> :       "ω"    U03C9    # GREEK SMALL LETTER OMEGA

相关内容