Gibt es eine Möglichkeit, die Rolle der Tastaturaktion Umschalt + [1..9] umzukehren? Grundsätzlich verwende ich die Symbole auf den Zahlen viel häufiger als die Zahlen selbst. Ich habe den Nummernblock für die Zahlen. Und viele dieser Symbole werden in Codierung und Latex verwendet. Wenn also jemand weiß, wie ich [email protected]#$%^&*() ohne die Verwendung von Shift erhalten kann, wäre ich sehr dankbar.
Akzeptierte Antwort:
Dies ist eigentlich ziemlich einfach mit xmodmap zu erreichen. Erstellen Sie einfach eine neue Datei mit dem Folgenden:
keycode 10 = exclam 1 exclam 1
keycode 11 = at 2 at 2
keycode 12 = numbersign 3 numbersign 3
keycode 13 = dollar 4 dollar 4
keycode 14 = percent 5 percent 5
keycode 15 = asciicircum 6 asciicircum 6
keycode 16 = ampersand 7 ampersand 7
keycode 17 = asterisk 8 asterisk 8
keycode 18 = parenleft 9 parenleft 9
keycode 19 = parenright 0 parenright 0
Speichern Sie es im Stammverzeichnis Ihres Home-Verzeichnisses als .Xmodmap (Groß-/Kleinschreibung ist wichtig). Melden Sie sich jetzt einfach ab und wieder an (möglicherweise müssen Sie neu starten), und Ihre Schlüssel werden ausgetauscht. Lesen Sie weiter, wie ich darauf gekommen bin. Die Informationen, mit denen ich das herausgefunden habe, stammen von hier. Starten Sie ein Terminal und geben Sie den folgenden Befehl ein:
xmodmap -pke
Dies wird eine Reihe von Schlüsselcode-Einstellungs-/Wertpaaren ausspucken, etwa so:
......
keycode 27 = r R r R
keycode 28 = t T t T
keycode 29 = y Y y Y
keycode 30 = u U u U
keycode 31 = i I i I
keycode 32 = o O o O
keycode 33 = p P p P
keycode 34 = bracketleft braceleft bracketleft braceleft
keycode 35 = bracketright braceright bracketright braceright
keycode 36 = Return NoSymbol Return
keycode 37 = Control_L NoSymbol Control_L
keycode 38 = a A a A
keycode 39 = s S s S
keycode 40 = d D d D
keycode 41 = f F f F
keycode 42 = g G g G
keycode 43 = h H h H
keycode 44 = j J j J
keycode 45 = k K k K
......
Der Keycode ist die Taste auf Ihrer physischen Tastatur, und der Wert rechts vom Gleichheitszeichen wird an Ihren PC gesendet. Der Grund dafür, dass es vier gibt, ist, dass der erste einfach ist, der zweite mit gedrückter Umschalttaste und der dritte (einfach) und der vierte (Umschalttaste) scheinen aktiviert zu sein, sobald Sie auf die Schaltfläche Scroll Lock klicken. Wie Sie sehen können, gibt Ihnen dies viel Flexibilität, um alles zu tun, was Sie sich vorstellen können, um Ihre Tastatur zu modifizieren.
Jetzt funktioniert dies nur, wenn Sie bei X angemeldet sind (wie in der GUI), daher der Name. Wenn Sie ein Terminal in Gnome, Unity usw. starten, können Sie Xmodmap immer noch gut verwenden, aber wenn Sie die gleiche Funktionalität in der Konsole wünschen (d.h. nach dem Drücken von STRG+ALT+1, in eine Box sshen, auf einem Server arbeiten oder ein PC ohne GUI) müssen Sie Loadkeys verwenden. Obwohl die allgemeine Idee dieselbe ist, bietet loadkeys viel mehr Funktionalität und Granularität, sodass es etwas komplizierter ist. Nun, diese Befehle MÜSSEN alle von der eigentlichen Konsole aus ausgeführt werden, sie können nicht mit einem Terminalemulator ausgeführt werden, oder Sie erhalten eine Fehlermeldung wie diese:Couldn't get a file descriptor referring to the console
.
Zuerst müssen wir unsere Standard-Tastaturbelegung wie folgt erstellen:
dumpkeys > ~/my_keymap.map
Es wäre eine gute Idee, eine Kopie davon zu machen, falls Sie es wirklich vermasseln. Jetzt müssen wir es nur noch mit unseren Änderungen bearbeiten. Jede Schlüsseldefinition sieht folgendermaßen aus:
keycode 2 = one exclam one one
alt keycode 2 = Meta_one
shift alt keycode 2 = Meta_exclam
altgr alt keycode 2 = Meta_one
shift altgr alt keycode 2 = Meta_one
shiftl keycode 2 = one
shift shiftl keycode 2 = exclam
altgr shiftl keycode 2 = one
shift altgr shiftl keycode 2 = one
alt shiftl keycode 2 = Meta_one
shift alt shiftl keycode 2 = Meta_exclam
altgr alt shiftl keycode 2 = Meta_one
shift altgr alt shiftl keycode 2 = Meta_one
shiftr keycode 2 = one
shift shiftr keycode 2 = exclam
altgr shiftr keycode 2 = one
shift altgr shiftr keycode 2 = one
alt shiftr keycode 2 = Meta_one
shift alt shiftr keycode 2 = Meta_exclam
altgr alt shiftr keycode 2 = Meta_one
shift altgr alt shiftr keycode 2 = Meta_one
shiftl shiftr keycode 2 = one
shift shiftl shiftr keycode 2 = exclam
altgr shiftl shiftr keycode 2 = one
shift altgr shiftl shiftr keycode 2 = one
alt shiftl shiftr keycode 2 = Meta_one
shift alt shiftl shiftr keycode 2 = Meta_exclam
altgr alt shiftl shiftr keycode 2 = Meta_one
shift altgr alt shiftl shiftr keycode 2 = Meta_one
ctrll keycode 2 = one
shift ctrll keycode 2 = exclam
altgr ctrll keycode 2 = one
shift altgr ctrll keycode 2 = one
alt ctrll keycode 2 = Meta_one
shift alt ctrll keycode 2 = Meta_exclam
altgr alt ctrll keycode 2 = Meta_one
shift altgr alt ctrll keycode 2 = Meta_one
shiftl ctrll keycode 2 = one
shift shiftl ctrll keycode 2 = exclam
altgr shiftl ctrll keycode 2 = one
shift altgr shiftl ctrll keycode 2 = one
alt shiftl ctrll keycode 2 = Meta_one
shift alt shiftl ctrll keycode 2 = Meta_exclam
altgr alt shiftl ctrll keycode 2 = Meta_one
shift altgr alt shiftl ctrll keycode 2 = Meta_one
shiftr ctrll keycode 2 = one
shift shiftr ctrll keycode 2 = exclam
altgr shiftr ctrll keycode 2 = one
shift altgr shiftr ctrll keycode 2 = one
alt shiftr ctrll keycode 2 = Meta_one
shift alt shiftr ctrll keycode 2 = Meta_exclam
altgr alt shiftr ctrll keycode 2 = Meta_one
shift altgr alt shiftr ctrll keycode 2 = Meta_one
shiftl shiftr ctrll keycode 2 = one
shift shiftl shiftr ctrll keycode 2 = exclam
altgr shiftl shiftr ctrll keycode 2 = one
shift altgr shiftl shiftr ctrll keycode 2 = one
alt shiftl shiftr ctrll keycode 2 = Meta_one
shift alt shiftl shiftr ctrll keycode 2 = Meta_exclam
altgr alt shiftl shiftr ctrll keycode 2 = Meta_one
shift altgr alt shiftl shiftr ctrll keycode 2 = Meta_one
Wie Sie sehen können, bietet es viel mehr Funktionalität/Granularität. Tauschen Sie für jeden Schlüssel einfach die Verschiebung und die regulären Werte aus, dh hier wäre der vertauschte Schlüssel:
keycode 2 = exclam one exclam exclam
alt keycode 2 = Meta_exclam
shift alt keycode 2 = Meta_one
altgr alt keycode 2 = Meta_exclam
shift altgr alt keycode 2 = Meta_exclam
shiftl keycode 2 = exclam
shift shiftl keycode 2 = one
altgr shiftl keycode 2 = exclam
shift altgr shiftl keycode 2 = exclam
alt shiftl keycode 2 = Meta_exclam
shift alt shiftl keycode 2 = Meta_one
altgr alt shiftl keycode 2 = Meta_exclam
shift altgr alt shiftl keycode 2 = Meta_exclam
shiftr keycode 2 = exclam
shift shiftr keycode 2 = one
altgr shiftr keycode 2 = exclam
shift altgr shiftr keycode 2 = exclam
alt shiftr keycode 2 = Meta_exclam
shift alt shiftr keycode 2 = Meta_one
altgr alt shiftr keycode 2 = Meta_exclam
shift altgr alt shiftr keycode 2 = Meta_exclam
shiftl shiftr keycode 2 = exclam
shift shiftl shiftr keycode 2 = one
altgr shiftl shiftr keycode 2 = exclam
shift altgr shiftl shiftr keycode 2 = exclam
alt shiftl shiftr keycode 2 = Meta_exclam
shift alt shiftl shiftr keycode 2 = Meta_one
altgr alt shiftl shiftr keycode 2 = Meta_exclam
shift altgr alt shiftl shiftr keycode 2 = Meta_exclam
ctrll keycode 2 = exclam
shift ctrll keycode 2 = one
altgr ctrll keycode 2 = exclam
shift altgr ctrll keycode 2 = exclam
alt ctrll keycode 2 = Meta_exclam
shift alt ctrll keycode 2 = Meta_one
altgr alt ctrll keycode 2 = Meta_exclam
shift altgr alt ctrll keycode 2 = Meta_exclam
shiftl ctrll keycode 2 = exclam
shift shiftl ctrll keycode 2 = one
altgr shiftl ctrll keycode 2 = exclam
shift altgr shiftl ctrll keycode 2 = exclam
alt shiftl ctrll keycode 2 = Meta_exclam
shift alt shiftl ctrll keycode 2 = Meta_exclam
altgr alt shiftl ctrll keycode 2 = Meta_exclam
shift altgr alt shiftl ctrll keycode 2 = Meta_exclam
shiftr ctrll keycode 2 = exclam
shift shiftr ctrll keycode 2 = one
altgr shiftr ctrll keycode 2 = exclam
shift altgr shiftr ctrll keycode 2 = exclam
alt shiftr ctrll keycode 2 = Meta_exclam
shift alt shiftr ctrll keycode 2 = Meta_one
altgr alt shiftr ctrll keycode 2 = Meta_exclam
shift altgr alt shiftr ctrll keycode 2 = Meta_exclam
shiftl shiftr ctrll keycode 2 = exclam
shift shiftl shiftr ctrll keycode 2 = one
altgr shiftl shiftr ctrll keycode 2 = exclam
shift altgr shiftl shiftr ctrll keycode 2 = exclam
alt shiftl shiftr ctrll keycode 2 = Meta_exclam
shift alt shiftl shiftr ctrll keycode 2 = Meta_one
altgr alt shiftl shiftr ctrll keycode 2 = Meta_exclam
shift altgr alt shiftl shiftr ctrll keycode 2 = Meta_exclam
Der Grund für die zusätzliche Granularität liegt darin, dass Sie bei der Verwendung der Konsole aufgrund ihrer Natur dazu neigen, viel mehr Tastenkombinationen zu verwenden.
Verwandte:Wie installiere ich Tor in Ubuntu?Um Ihre Änderungen jetzt zu testen, können Sie den folgenden Befehl verwenden:
loadkeys ~/my_keymap.map
Spielen Sie herum, verwenden Sie einige Programme, die Sie normalerweise verwenden, und stellen Sie sicher, dass es so funktioniert, wie Sie es möchten. Wenn Sie es vermasselt haben, können Sie einfach die loadkeys
verwenden Befehl, um auf die Standardeinstellung zurückzufallen. Um es dauerhaft zu machen, können Sie den Befehl am Ende Ihres ~/.bashrc
hinzufügen Datei.