Clavier
De Banane Atomic
Aller à la navigationAller à la recherche
azerty vs querty
fr-latin9 (ISO 8859-15)
fr-latin1 (ISO 8859-1) vs fr-latin9 (ISO 8859-15)
Position | 0xA4 | 0xA6 | 0xA8 | 0xB4 | 0xB8 | 0xBC | 0xBD | 0xBE |
---|---|---|---|---|---|---|---|---|
8859-1 | ¤ | ¦ | ¨ | ´ | ¸ | ¼ | ½ | ¾ |
8859-15 | € | Š | š | Ž | ž | Œ | œ | Ÿ |
fr-oss
bépo
Changer de configuration de clavier
- Terminal → vconsole.conf
- Xorg
Changez l'affectation des touches clavier pour Xorg
Mapping des keycodes: /usr/share/X11/xkb/keycodes/evdev
Les noms des keysyms se trouvent dans /usr/include/X11/keysymdef.h, elles peuvent être facilement trouvées grâce à leurs codes unicode. |
Ajouter une variante à un clavier existant
Ajoute une variante fr_nonum au clavier ch:
/usr/share/X11/xkb/symbols/ch |
// ajouter à la fin du fichier partial alphanumeric_keys xkb_symbols "fr_nonum" { // modify the basic Swiss French layout include "ch(fr)" name[Group1]= "French (Switzerland, NoNum)"; key <TLDE> { [ asciitilde, degree, section, ellipsis ] }; // remap 1 + | to ÷ ± | ¹ key <AE01> { [ division, plusminus, brokenbar, onesuperior ] }; key <AE02> { [ quotedbl, at, at, twosuperior ] }; key <AE03> { [ numbersign, star, numbersign, threesuperior ] }; key <AE04> { [ ccedilla, Ccedilla, onequarter, threequarters ] }; key <AE05> { [ percent, permille, fiveeighths, fiveeighths ] }; key <AE06> { [ ampersand, bar, notsign, threequarters ] }; key <AE07> { [ backslash, slash, bar, seveneighths ] }; key <AE08> { [ parenleft, bracketleft, braceleft ] }; key <AE09> { [ parenright, bracketright, braceright ] }; key <AE10> { [ equal, notequal, approxeq ] }; key <AD07> { [ u, U, ugrave, Ugrave ] }; key <AD08> { [ i, I, infinity ] }; key <AD11> { [ egrave, Egrave ] }; key <AD12> { [ exclam, dead_diaeresis, bracketright, exclamdown ] }; key <AC10> { [ eacute, Eacute ] }; key <AC11> { [ agrave, Agrave ] }; key <AB01> { [ y, Y, guillemotleft, lessthanequal ] }; key <AB02> { [ x, X, guillemotright, greaterthanequal ] }; key <AB03> { [ c, C, copyright ] }; key <AB08> { [ coma, semicolon, leftarrow ] }; key <AB09> { [ period, colon, downarrow, uparrow ] }; key <AB10> { [ underbar, rightarrow, implies, ellipsis ] }; }; |
|
Rendre cette variante disponible dans la sélection des claviers
/usr/share/X11/xkb/rules/evdev.xml |
<layout> <configItem> <name>ch</name> </configItem> <variantList> <variant> <configItem> <name>fr_nonum</name> <description>French (Switzerland, NoNum)</description> </configItem> </variant> </variantList> </layout> |
Configurer Xorg pour utiliser cette variante
/etc/X11/xorg.conf.d/20-keyboard-layout.conf |
Section "InputClass" Identifier "evdev keyboard catchall" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" Driver "evdev" Option "XkbModel" "pc105" Option "XkbLayout" "ch" Option "XkbVariant" "fr_nonum" EndSection |
Éviter que les fichiers ne soient écrasés par une mise à jour
sudo mkdir /usr/share/X11/xkb/custom sudo cp /usr/share/X11/xkb/rules/evdev.xml /usr/share/X11/xkb/custom/evdev.xml sudo rm /usr/share/X11/xkb/rules/evdev.xml sudo ln -s /usr/share/X11/xkb/custom/evdev.xml /usr/share/X11/xkb/rules/evdev.xml sudo cp /usr/share/X11/xkb/symbols/ch /usr/share/X11/xkb/custom/ch sudo rm /usr/share/X11/xkb/symbols/ch sudo ln -s /usr/share/X11/xkb/custom/ch /usr/share/X11/xkb/symbols/ch |
Ainsi lors d'une mise à jour, seuls les liens symboliques seront écrasés, il suffira de les recréer.
remap.sh |
rm -f /usr/share/X11/xkb/rules/evdev.xml.bak mv /usr/share/X11/xkb/rules/evdev.xml /usr/share/X11/xkb/rules/evdev.xml.bak ln -s /usr/share/X11/xkb/custom/evdev.xml /usr/share/X11/xkb/rules/evdev.xml rm -f /usr/share/X11/xkb/symbols/ch.bak mv /usr/share/X11/xkb/symbols/ch /usr/share/X11/xkb/symbols/ch.bak ln -s /usr/share/X11/xkb/custom/ch /usr/share/X11/xkb/symbols/ch |
sudo meld /usr/share/X11/xkb/custom/evdev.xml /usr/share/X11/xkb/rules/evdev.xml.bak sudo meld /usr/share/X11/xkb/custom/ch /usr/share/X11/xkb/symbols/ch.bak |
An Unreliable Guide to XKB Configuration
xkbcomp
# générer le fichier .Xkeymap qui contient la configuration clavier actuelle xkbcomp $DISPLAY ~/.Xkeymap |
~/.Xkeymap |
# remappe la touche 1 + | → + 1| # <AE01> = 10; key <AE01> { type= "FOUR_LEVEL", # symbols[Group1]= [ 1, plus, bar, exclamdown ] symbols[Group1]= [ plus, 1, bar, exclamdown ] }; # remappe la touche § ° # <TLDE> = 49; key <TLDE> { type= "FOUR_LEVEL", # symbols[Group1]= [ section, degree, notsign, notsign ] symbols[Group1]= [ degree, onehalf, onequarter, threequarters ] }; |
Obtenir le code d'une touche
Utiliser xev:
Touche q → keycode 24 → <AD01> = 24; dans .Xkeymap
KeyPress event, serial 36, synthetic NO, window 0x2e00001, root 0x29f, subw 0x0, time 2945542, (656,359), root:(657,437), state 0x10, keycode 24 (keysym 0x71, q), same_screen YES, XLookupString gives 1 bytes: (71) "q" XmbLookupString gives 1 bytes: (71) "q" XFilterEvent returns: False
Exécuter xkbcomp au lancement de Xorg
~/.xinitrc |
test -f ~/.Xkeymap && xkbcomp ~/.Xkeymap $DISPLAY |
Xmodmap
Xmodmap (en) permet de modifier la disposition du clavier.
# liste de l'affectation actuelle des touches xmodmap -pke # connaître le code des touches pressées xev | sed -n 's/.*keycode *\([0-9]\+\)[^,]*, \([^)]\+\)).*$/keycode \1, keysym \2/p' |
Le fichier ~/.Xmodmap contient la liste des réaffectations de touches à réaliser:
~/.Xmodmap |
# code clavier 24 # normal | Maj | mode_switch | mode_switch + Maj | AltGr | AltGr + Maj | AltGr + mode_switch | AltGr + mode_switch + Maj keycode 9 = Escape NoSymbol Escape keycode 24 = a A a A acircumflex adiaeresis ae AE q Q |
Gnome detecte automatiquement le fichier ~/.Xmodmap et demande s'il doit l'utiliser. |
Xbindkeys
Permet d'associer un bouton à une commande ou de remapper un raccourci.
Changez l'affectation des touches clavier dans la console
# création du dossier sudo mkdir -p /usr/local/share/kbd/keymaps # copie d'un keymap existant pour modification sudo gunzip /usr/share/kbd/keymaps/i386/qwertz/fr_CH-latin1.map.gz -c > /usr/local/share/kbd/keymaps/fr_CH-custom.map |
Les keymaps système se trouvent dans le dossier /usr/share/kbd/keymaps/ |
/usr/local/share/kbd/keymaps/fr_CH-nonum.map |
# keymaps définit les colonnes des lignes keycode # 0 none # 1 Shift # 2 AltGr # 3 Shift+AltGr # 4 Control # 5 Shift+Control # 6 AltGr+Control # 7 Shift+AltGr+Control # 8 Alt # 9 Shift+Alt # 10 AltGr+Alt # 11 Shift+AltGr+Alt # 12 Control+Alt # 13 Shift+Control+Alt # 14 AltGr+Control+Alt # 15 Shift+AltGr+Control+Alt keymaps 0-4,6,8,12 # keycode XX = none Shift AltGr Shift+AltGr Control AltGr+Control Alt Control+Alt include "qwertz-layout" include "linux-with-alt-and-altgr" strings as usual keycode 1 = degree section shift control keycode 1 = ... # Shift + Ctrl altgr control keycode 1 = ... # Ctrl + AltGr alt keycode 1 = ... # Alt keycode 2 = division plusminus keycode 3 = quotedbl at at onequarter keycode 4 = numbersign asterisk numbersign keycode 5 = ccedilla Ccedilla nul onehalf keycode 6 = percent permille keycode 7 = ampersand ampersand nul threequarters keycode 8 = backslash slash keycode 9 = parenleft parenleft cent keycode 10 = parenright parenright keycode 11 = equal equal keycode 12 = apostrophe question dead_acute questiondown keycode 13 = dead_circumflex dead_grave dead_tilde keycode 14 = Delete Delete alt keycode 14 = Meta_Delete keycode 15 = Tab Meta_Tab alt keycode 15 = Meta_Tab keycode 19 = +r +R registered keycode 20 = +t +T trademark keycode 22 = +t +U ugrave keycode 24 = +o +O oe OE keycode 26 = egrave Egrave bracketleft keycode 27 = exclam dead_diaeresis bracketright exclamdown keycode 28 = Return alt keycode 28 = Meta_Control_m keycode 29 = Control keycode 39 = eacute Eacute keycode 40 = agrave Agrave braceleft keycode 41 = section degree control keycode 41 = nul alt keycode 41 = Meta_grave keycode 42 = Shift keycode 43 = dollar sterling braceright control keycode 43 = Control_backslash alt keycode 43 = Meta_backslash keycode 44 = +y +Y guillemotleft keycode 45 = +x +X guillemotright keycode 46 = +c +C copyright cent keycode 53 = underscore minus keycode 54 = Shift keycode 56 = Alt keycode 57 = space space control keycode 57 = nul alt keycode 57 = Meta_space keycode 58 = Caps_Lock keycode 86 = less greater backslash alt keycode 86 = Meta_less keycode 97 = Control # adapted to X11 keymap altgr keycode 18 = currency #altgr keycode 46 = cent |
Documentation man keymaps |
Valeurs non acceptées:
|
/etc/vconsole.conf |
KEYMAP=/usr/local/share/kbd/keymaps/fr_CH-custom.map |
Nom des caractères en anglais
Caractère | Nom en français | Nom en anglais |
---|---|---|
: | deux points | colon |
; | point-virgule | semicolon |
. | point | period, dot |
, | virgule | comma |
! | point d'exclamation | exclamation point, bang |
? | point d'interrogation | question mark |
() | parenthèses | parenthesis |
[] | crochets | square brackets |
{} | accolades | curly braces |
" | guillemets | double quotes |
' | single quote | |
` | back quote, backtick | |
# | dièse | sharp |
& | éperluette, et commercial | ampersand |
* | étoile | asterisk, star |
- | tiret, moins | hyphen, minus, dash |
_ | tiret du bas | underscore |
| | pipe, vertical bar | |
° | Degree | |
§ | micro, section | |
£ | pounds sterling, pound symbol |
XUL Typist
Programme permettant de s'entainer à la saisie clavier.