在 X11 中创造不死生物

在 X11 中创造不死生物

我使用的是瑞典语键盘,这个键盘上装有死键也就是说,要产生 'ä',我会按下(与/"相同的按钮),然后(或按下专用的-按钮...),而要产生 ,我会按下相同的按钮,然后按空格。 和其他类似键也是一样。~^aä"`

问题是,我`最近使用得越来越多。每次我需要简单操作时Shift`按下 ,并不像看起来那么有趣。我是 Emacs 的粉丝,我通常喜欢奇怪的键盘组合。Space`

无论如何,我想将我的`'±按钮重新映射到输出(最好)仅有的 `,就像在我的 Mac 上一样。我可以忍受它输出其他无效键,只要它输出时`没有任何其他击键即可。

我在这台电脑上主要使用 X11(X.org、Archlinux 等)。我使用的是键盘布局称为 Svorak A5,这是否会产生任何影响。我尝试根据英文版 dvorak 布局修改此文件,但根本无法使其工作。我宁愿不使用 Xmodmap,但这真的不是问题。有什么想法吗?

答案1

要求 Magnus 将以下几行附加到他的文件中(或者自己动手:-)):

partial alphanumeric_keys xkb_symbols "svorak_nodeadkeys" {
    include "magnus_xkb_se(svorak)"
    name[Group1]="Svorak A5 - Eliminate dead keys";
    key <AD12> { [ dead_diaeresis, asciicircum, asciitilde, dead_circum ] };
    key <AE12> { [ acute,          grave,       plusminus,  none        ] };
};

这里我假设你想保留分音符¨作为死键,因为我不知道有任何编程语言或系统命令实际上需要此字符。否则,映射是相同的。

就我个人而言,我会将 AD12 键的定义更改为:

    key <AD12> { [ asciitilde, asciicircum, dead_diaeresis, dead_circum ] };

因为键盘布局已经有Ö作为单独的字符,以及波浪符号~在Unix中经常使用。

用以下命令激活:

setxkbmap -layout magnus_xkb_se -variant svorak_nodeadkeys

请注意,如果magnus_xkb_se不是布局所在文件的名称,则必须在文件和命令中相应地更改它们 - 例如,如果您被告知将所有内容附加到主se文件中。

答案2

来自芬兰的问候 - 您可能知道我们与您有相同的字母表。我有一个 Svorak 布局文件,其工作方式与芬兰语(我想瑞典语也是如此)QWERTY 一样,只是布局是 Svorak。死键不多,最多也就是默认芬兰语 QWERTY 中设置为死键的几个......

虽然这个文件是用于 Xmodmap 的,但它的工作原理与其他文件一样好 - 并且更改为 Svorak 的命令很短:“xmodmap ~/.svorak(当然,我已将其设置为在启动 X 服务器时自动运行 - 但我也有“脚本”文件,用于在绑定到 gkrellm 中的启动器按钮的 QWERTY 和 Svorak 之间切换(对于访问者,我只使用 Svorak)。

它有点长,但我会将我的 .svorak 文件的内容粘贴到这里 - 它是用于 Xmodmap 的,但它可以解决您的问题 - 如果您仍然想消除剩下的几个死键,它的语法非常简单:)

keycode   8 =
keycode   9 = Escape
keycode  10 = 1 exclam onesuperior exclamdown
keycode  11 = 2 quotedbl at oneeighth
keycode  12 = 3 numbersign sterling sterling
keycode  13 = 4 currency dollar dollar
keycode  14 = 5 percent onehalf threeeighths
keycode  15 = 6 ampersand threequarters fiveeighths
keycode  16 = 7 slash braceleft seveneighths
keycode  17 = 8 parenleft bracketleft trademark
keycode  18 = 9 parenright bracketright plusminus
keycode  19 = 0 equal braceright degree
keycode  20 = plus question backslash questiondown
keycode  21 = acute grave dead_cedilla dead_ogonek
keycode  22 = BackSpace Terminate_Server
keycode  23 = Tab ISO_Left_Tab
keycode  24 = aring Aring dead_diaeresis dead_abovering
keycode  25 = adiaeresis Adiaeresis dead_circumflex dead_caron
keycode  26 = odiaeresis Odiaeresis dead_acute dead_doubleacute
keycode  27 = p P thorn THORN
keycode  28 = y Y leftarrow yen
keycode  29 = f F dstroke ordfeminine
keycode  30 = g G eng ENG
keycode  31 = c C cent copyright
keycode  32 = r R paragraph registered
keycode  33 = l L lstroke Lstroke
keycode  34 = comma semicolon horizconnector multiply
keycode  35 = dead_diaeresis asciicircum dead_tilde dead_macron
keycode  36 = Return
keycode  37 = Control_L
keycode  38 = a A ae AE
keycode  39 = o O oslash Oslash
keycode  40 = e E EuroSign cent EuroSign cent
keycode  41 = u U downarrow uparrow
keycode  42 = i I rightarrow idotless
keycode  43 = d D eth ETH
keycode  44 = h H hstroke Hstroke
keycode  45 = t T tslash Tslash
keycode  46 = n N
keycode  47 = s S ssharp section
keycode  48 = minus underscore dead_belowdot dead_abovedot
keycode  49 = section onehalf notsign
keycode  50 = Shift_L
keycode  51 = apostrophe asterisk dead_grave dead_breve
keycode  52 = period colon periodcentered division
keycode  53 = q Q at Greek_OMEGA
keycode  54 = j J
keycode  55 = k K kra ampersand
keycode  56 = x X guillemotright greater
keycode  57 = b B rightdoublequotemark apostrophe
keycode  58 = m M mu masculine
keycode  59 = w W lstroke Lstroke
keycode  60 = v V leftdoublequotemark grave
keycode  61 = z Z guillemotleft less
keycode  62 = Shift_R
keycode  63 = KP_Multiply
keycode  64 = Alt_L Meta_L
keycode  65 = space
keycode  66 = Caps_Lock
keycode  67 = F1 XF86_Switch_VT_1
keycode  68 = F2 XF86_Switch_VT_2
keycode  69 = F3 XF86_Switch_VT_3
keycode  70 = F4 XF86_Switch_VT_4
keycode  71 = F5 XF86_Switch_VT_5
keycode  72 = F6 XF86_Switch_VT_6
keycode  73 = F7 XF86_Switch_VT_7
keycode  74 = F8 XF86_Switch_VT_8
keycode  75 = F9 XF86_Switch_VT_9
keycode  76 = F10 XF86_Switch_VT_10
keycode  77 = Num_Lock Pointer_EnableKeys
keycode  78 = Scroll_Lock
keycode  79 = KP_Home KP_7
keycode  80 = KP_Up KP_8
keycode  81 = KP_Prior KP_9
keycode  82 = KP_Subtract XF86_Prev_VMode
keycode  83 = KP_Left KP_4
keycode  84 = KP_Begin KP_5
keycode  85 = KP_Right KP_6
keycode  86 = KP_Add XF86_Next_VMode
keycode  87 = KP_End KP_1
keycode  88 = KP_Down KP_2
keycode  89 = KP_Next KP_3
keycode  90 = KP_Insert KP_0
keycode  91 = KP_Delete KP_Separator
keycode  92 =
keycode  93 = Mode_switch
keycode  94 = less greater bar brokenbar
keycode  95 = F11 XF86_Switch_VT_11
keycode  96 = F12 XF86_Switch_VT_12
keycode  97 = Home
keycode  98 = Up
keycode  99 = Prior
keycode 100 = Left
keycode 101 =
keycode 102 = Right
keycode 103 = End
keycode 104 = Down
keycode 105 = Next
keycode 106 = Insert
keycode 107 = Delete
keycode 108 = KP_Enter
keycode 109 = Control_R
keycode 110 = Pause Break
keycode 111 = Print Execute
keycode 112 = KP_Divide XF86_Ungrab
keycode 113 = Mode_switch
keycode 114 =
keycode 115 = Super_L
keycode 116 = Multi_key
keycode 117 = Menu
keycode 118 =
keycode 119 =
keycode 120 =
keycode 121 =
keycode 122 =
keycode 123 =
keycode 124 = ISO_Level3_Shift
keycode 125 = NoSymbol Alt_L
keycode 126 = KP_Equal
keycode 127 = NoSymbol Super_L
keycode 128 = NoSymbol Hyper_L
keycode 129 =
keycode 130 =
keycode 131 =
keycode 132 =
keycode 133 =
keycode 134 =
keycode 135 =
keycode 136 =
keycode 137 =
keycode 138 =
keycode 139 =
keycode 140 =
keycode 141 =
keycode 142 =
keycode 143 =
keycode 144 =
keycode 145 =
keycode 146 =
keycode 147 =
keycode 148 =
keycode 149 =
keycode 150 =
keycode 151 =
keycode 152 =
keycode 153 =
keycode 154 =
keycode 155 =
keycode 156 = NoSymbol Meta_L
keycode 157 =
keycode 158 =
keycode 159 =
keycode 160 =
keycode 161 =
keycode 162 =
keycode 163 =
keycode 164 =
keycode 165 =
keycode 166 =
keycode 167 =
keycode 168 =
keycode 169 =
keycode 170 =
keycode 171 =
keycode 172 =
keycode 173 =
keycode 174 =
keycode 175 =
keycode 176 =
keycode 177 =
keycode 178 =
keycode 179 =
keycode 180 =
keycode 181 =
keycode 182 =
keycode 183 =
keycode 184 =
keycode 185 =
keycode 186 =
keycode 187 =
keycode 188 =
keycode 189 =
keycode 190 =
keycode 191 =
keycode 192 =
keycode 193 =
keycode 194 =
keycode 195 =
keycode 196 =
keycode 197 =
keycode 198 =
keycode 199 =
keycode 200 =
keycode 201 =
keycode 202 =
keycode 203 =
keycode 204 =
keycode 205 =
keycode 206 =
keycode 207 =
keycode 208 =
keycode 209 =
keycode 210 =
keycode 211 =
keycode 212 =
keycode 213 =
keycode 214 =
keycode 215 =
keycode 216 =
keycode 217 =
keycode 218 =
keycode 219 =
keycode 220 =
keycode 221 =
keycode 222 =
keycode 223 =
keycode 224 =
keycode 225 =
keycode 226 =
keycode 227 =
keycode 228 =
keycode 229 =
keycode 230 =
keycode 231 =
keycode 232 =
keycode 233 =
keycode 234 =
keycode 235 =
keycode 236 =
keycode 237 =
keycode 238 =
keycode 239 =
keycode 240 =
keycode 241 =
keycode 242 =
keycode 243 =
keycode 244 =
keycode 245 =
keycode 246 =
keycode 247 =
keycode 248 =
keycode 249 =
keycode 250 =
keycode 251 =
keycode 252 =
keycode 253 =
keycode 254 =
keycode 255 =

哦,如果您也需要一种方法来在 Svorak 和 QWERTY 之间快速切换,那么对于 QWERTY 我使用 setxkbmap,我使用的命令是:

setxkbmap -layout fi -model pc105 -option

应该很容易找出瑞典的对应词 - 尽管它们可能完全相同...希望这对你有所帮助并祝你好运:)

相关内容