[Résolu / contourné]deux claviers; un FR et un USB swe

bonjour,

Je ne sais pas si mon titre est des plus appropié mais je vais tenter d’être plus clair maintenant.

J’ai installé une debian testing sur un IBM T40p, j’utilise Gnome. donc un portable avec un clavier français.
Maintenant il se trouve que la grande majorité du temps j’utilise le portable plus ou moin en fixe avec un clavier usb qui lui est avec un layout suédois.

J’aimerais si c"est possible pouvoir dire à debian que
si c’est le clavier de l’ordi alors => FR
si c’est le clavier USB alors => SWE
:smt100
Faut-il aller dans Xorg pour faire cela?

Sinon j’aimerais au moin pouvoir juste switcher entre les deux layouts, ce que je ne sais pas faire… (ça ne marche pas avec l’utilitaire clavier de gnome :confused: )

D’avance merci pour vos réponses :smt058

aprioris, tu devras rajouté une section InpuptDevice dans ton xorg.conf et modifier le ServerLayout en ajoutant la ligne correspondant à l’InputDevice prédéfini.

Pour ce qui est du switchage… je n’en sais rien…

je vais regarder de ce pas, j’ai juste oublié de préciser, le clavier marche à merveille, c’est juste que pour l’instant il est en fr et les touches sont elles en suédois…

(Il pleut pour ce que cela intérresse :frowning: )

alors voici pour le test rapide:

je suis bien en clavier su´edois => åöä
mais je ne sais pas vraiment pourquoi :stuck_out_tongue:

voici la partie interressante de mon /etc/X11/xorg.conf

[code]
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option “XkbRules” "xorg"
Option “XkbModel” "pc105"
Option “XkbLayout” "fr"
Option “XkbVariant” "latin9"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option “XkbRules” "xorg"
Option “XkbModel” "pc105"
Option “XkbLayout” "se"
Option “XkbVariant” "latin9"
EndSection[/code]

Bon apparament il ne prend plus en compte la variante FR du layout mais que la variante SE… :confused: Il y a-t-il un moyen de de lui dire pour quel clavier est chaque input?

il faut leur définir un “Identifier” différent

[quote=“wake”]alors voici pour le test rapide:

je suis bien en clavier su´edois => åöä
[/quote]

edj ! :laughing:

Desactive la ligne XkbVariant pour voir, dans mon xorg elle n’apparait pas, et ça marche trés bien.

edj?

Je suis repassé en clavier FR => ç je ne sais pas trop comment en revanche:P
Quel est la commande pour “relire” xorg.conf?

Damsss => le layout suédois c’est expres je veux le mettre sur le clavier usb:p mais pas sur l’autre…

[code]
Section "InputDevice"
Identifier "clavier IBM FR"
Driver "keyboard"
Option "CoreKeyboard"
Option “XkbRules” "xorg"
Option “XkbModel” "pc105"
Option “XkbLayout” "fr"
Option “XkbVariant” "latin9"
EndSection

Section "InputDevice"
Identifier "clavier USB SWE"
Driver "keyboard"
Option "CoreKeyboard"
Option “XkbRules” "xorg"
Option “XkbModel” "pc105"
Option “XkbLayout” "se"
EndSection[/code]

Je n’ai pas mon clavier usb sous la main, mais j’ai quand meme une petite question.
OK j’ai mis deux identifiers différents pour les deux claviers, mais nul part je précise quel identifier va vers quel clavier (en hardware) je peux faire cela ou et comment? :question:

me revoila,

voici mes avancées et mes questions :smt017 :stuck_out_tongue:

alors pour le xorg je pense qu’il faut mettre quelque chose dans ce style là

Section "InputDevice"
   Identifier   "clavier IBM FR"
   Driver      "keyboard"
   Option      "CoreKeyboard"
   Option      "Device" "/dev/input/event0" 
   Option      "XkbRules"   "xorg"
   Option      "XkbModel"   "pc105"
   Option      "XkbLayout"   "fr"
   Option      "XkbVariant"   "latin9"
EndSection

Section "InputDevice"
   Identifier   "clavier USB SWE"
   Driver      "keyboard"
   Option      "CoreKeyboard"
   Option      "Device" "/dev/input/event2" 
   Option      "XkbRules"   "xorg"
   Option      "XkbModel"   "pc105"
   Option      "XkbLayout"   "se"
EndSection

Le nouveau étant la ligne Option "Device" "/dev/input/eventX"
La complication étant de savoir à quel clavier correspond quel event :confused:

un ls -al /dev/input me donne

drwxr-xr-x 4 root root 300 2006-05-26 12:42 ./ drwxr-xr-x 15 root root 14K 2006-05-26 10:44 ../ drwxr-xr-x 2 root root 100 2006-05-26 12:42 by-id/ drwxr-xr-x 2 root root 120 2006-05-26 12:42 by-path/ crw-rw---- 1 root root 13, 64 2006-05-26 12:42 event0 crw-rw---- 1 root root 13, 65 2006-05-26 12:42 event1 crw-rw---- 1 root root 13, 66 2006-05-26 12:42 event2 crw-rw---- 1 root root 13, 67 2006-05-26 12:42 event3 crw-rw---- 1 root root 13, 68 2006-05-26 12:42 event4 crw-rw---- 1 root root 13, 69 2006-05-26 12:42 event5 crw-rw---- 1 root root 13, 70 2006-05-26 12:42 event6 crw-rw---- 1 root root 13, 63 2006-05-26 12:42 mice crw-rw---- 1 root root 13, 32 2006-05-26 12:42 mouse0 crw-rw---- 1 root root 13, 33 2006-05-26 12:42 mouse1 crw-rw---- 1 root root 13, 34 2006-05-26 12:42 mouse2

un ls -al /dev/input/by-id me donne

total 0 drwxr-xr-x 2 root root 100 2006-05-26 12:42 ./ drwxr-xr-x 4 root root 300 2006-05-26 12:42 ../ lrwxrwxrwx 1 root root 9 2006-05-26 12:42 usb-1267_PS.2+USB_Mouse-event-mouse -> ../event1 lrwxrwxrwx 1 root root 9 2006-05-26 12:42 usb-1267_PS.2+USB_Mouse-mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 2006-05-26 12:42 usb-Microsoft_Comfort_Curve_Keyboard_2000-event-kbd -> ../event2

et finalement un ls -al /dev/input/by-path me donne

drwxr-xr-x 2 root root 120 2006-05-26 12:42 ./ drwxr-xr-x 4 root root 300 2006-05-26 12:42 ../ lrwxrwxrwx 1 root root 9 2006-05-26 12:42 pci-0000:00:1d.7-usb-0:3.3:1.1-event-mouse -> ../event1 lrwxrwxrwx 1 root root 9 2006-05-26 12:42 pci-0000:00:1d.7-usb-0:3.3:1.1-mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 2006-05-26 12:42 pci-0000:00:1d.7-usb-0:3.4:1.0-event-kbd -> ../event2 lrwxrwxrwx 1 root root 9 2006-05-26 12:42 pci-0000:00:1d.7-usb-0:3.4:1.1-event- -> ../event3

:smt102

Bref, je pense que mon clavier USB est sous le event2, mais mon clavier normal (celui du portable) où est-il?

d’avance merci pour votre aide précieuse :smt100 :smt045

Hej, (j’ai confondu avec une lib d’E17)
Tu trouveras des infos sur les ressources usb avec :
cat /proc/bus/devices
et
lsusb (-v)
forum.ubuntu-fr.org/viewtopic.php?id=30532

[quote=“man xorg.conf”]INPUTDEVICE SECTION
The config file may have multiple InputDevice sections. There will normally be at least two: one for
the core (primary) keyboard, and one of the core pointer. If either of these two is missing, a default
configuration for the missing ones will be used. Currently the default configuration may not work as
expected on all platforms.

   InputDevice sections have the following format:

       Section "InputDevice"
           Identifier "name"
           Driver     "inputdriver"
           options
           ...
       EndSection

   The Identifier and Driver entries are required in all  InputDevice  sections.   All  other  entries  are
   optional.

   The  Identifier  entry  specifies the unique name for this input device.  The Driver entry specifies the
   name of the driver to use for this input device.  When using the loadable server, the input driver  mod-
   ule "inputdriver" will be loaded for each active InputDevice section.  An InputDevice section is consid-
   ered active if it is referenced by an active ServerLayout section, if it is referenced by the  -keyboard
   or -pointer command line options, or if it is selected implicitly as the core pointer or keyboard device
   in the absence of such explicit references.  The most commonly used input drivers are  keyboard(4x)  and
   mouse(4x).

   In the absence of an explicitly specified core input device, the first InputDevice marked as CorePointer
   (or CoreKeyboard) is used.  If there is no match there, the first InputDevice that uses the "mouse"  (or
   "keyboard" or "kbd") driver is used.  The final fallback is to use built-in default configurations.

   InputDevice sections recognise some driver-independent Options, which are described here.  See the indi-
   vidual input driver manual pages for a description of the device-specific options.

   Option "CorePointer"
          When this is set, the input device is installed as the core (primary) pointer device.  There must
          be  exactly one core pointer.  If this option is not set here, or in the ServerLayout section, or
          from the -pointer command line option, then the first input device that is capable of being  used
          as  a  core pointer will be selected as the core pointer.  This option is implicitly set when the
          obsolete Pointer section is used.

[b] Option "CoreKeyboard"
When this is set, the input device is to be installed as the core (primary) keyboard device.
There must be exactly one core keyboard. If this option is not set here, in the ServerLayout
section, or from the -keyboard command line option, then the first input device that is capable
of being used as a core keyboard will be selected as the core keyboard. This option is implic-
itly set when the obsolete Keyboard section is used.

  [u]Option "AlwaysCore"  "boolean"[/u]

   [u]Option "SendCoreEvents"  "boolean"[/u]
          Both of these options are equivalent, and when enabled cause the input device  to  always  report
          core  events.   This  can be used, for example, to allow an additional pointer device to generate
          core pointer events (like moving the cursor, etc).[/b]

   Option "HistorySize"  "number"
       Sets the motion history size.  Default: 0.

   Option "SendDragEvents"  "boolean"
          ???

[/quote]

si j’ai bien compris la manpage, il faut que tu en sélectionnes 1 par défaut avec le CoreKeyboard , ici j’utilise 1 clavier USB et voila le résultat de la commande de damss :

[quote]$ cat /proc/bus/input/devices
I: Bus=0003 Vendor=046d Product=c016 Version=0340
N: Name="Logitech Optical USB Mouse"
P: Phys=usb-0000:00:1d.1-1/input0
S: Sysfs=/class/input/input0
H: Handlers=mouse0 event0
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

I: Bus=0003 Vendor=413c Product=2003 Version=0301
N: Name="Dell Dell USB Keyboard"
P: Phys=usb-0000:00:1d.1-2/input0
S: Sysfs=/class/input/input1
H: Handlers=kbd event1
B: EV=120003
B: KEY=10000 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: LED=7

I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/class/input/input2
H: Handlers=kbd event2
B: EV=40001
B: SND=6[/quote]

que je peux vérifier en faisant un (faire ctrl + C pour récupérer la main) :

[quote]$ cat /dev/input/event1
œîvDªœîvDªk

je teste tout cela en ce moment même, merci je vous tiens au courant :wink:

Hej,

Bon alors voici mes avancées (c’est un grand mot :wink: )

alors dabord mes sections devices

[code]Section "InputDevice"
Identifier "KeyboardFR"
Driver “keyboard”

#Option 	    "Device"	"/dev/input/event0"
    Option	    "XkbRules" "xorg"
Option	    "XkbModel" "pc105"
Option	    "XkbLayout" "fr"

EndSection

Section "InputDevice"
Identifier "KeyboardSE"
Driver "keyboard"
Option “Dev Phys” "usb-0000:00:1d.7-3.4/input0"
Option “Device” "/dev/input/event2"
Option “XkbRules” "xorg"
Option “XkbModel” "pc105"
Option “XkbLayout” "se"
EndSection[/code]

et ma section server layout

Section "ServerLayout" Identifier "Default Layout" Screen "Default Screen" 0 0 InputDevice "KeyboardFR" InputDevice "Configured Mouse" InputDevice "Synaptics Touchpad" InputDevice "KeyboardSE" EndSection

mon cat /proc/bus/input/devices me donne

[code]I: Bus=0011 Vendor=0001 Product=0001 Version=ab54
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/class/input/input0
H: Handlers=kbd event0
B: EV=120013
B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7

I: Bus=0003 Vendor=1267 Product=0210 Version=0001
N: Name="PS/2+USB Mouse"
P: Phys=usb-0000:00:1d.7-3.3/input1
S: Sysfs=/class/input/input1
H: Handlers=mouse0 event1
B: EV=7
B: KEY=f0000 0 0 0 0 0 0 0 0
B: REL=103

I: Bus=0003 Vendor=045e Product=00dd Version=0173
N: Name="Microsoft Comfort Curve Keyboard 2000"
P: Phys=usb-0000:00:1d.7-3.4/input0
S: Sysfs=/class/input/input2
H: Handlers=kbd event2
B: EV=120003
B: KEY=10000 7 ff800000 7ff febeffdf f3cfffff ffffffff fffffffe
B: LED=7

I: Bus=0003 Vendor=045e Product=00dd Version=0173
N: Name="Microsoft Comfort Curve Keyboard 2000"
P: Phys=usb-0000:00:1d.7-3.4/input1
S: Sysfs=/class/input/input3
H: Handlers=kbd event3
B: EV=10000f
B: KEY=c0002 400 0 0 1 10f80 78007 ffe739fa d94157ff febeffdf ffefffff ffffffff fffffffe
B: REL=40
B: ABS=1 0

I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/class/input/input4
H: Handlers=kbd event4
B: EV=40001
B: SND=6

I: Bus=0011 Vendor=0002 Product=0007 Version=0000
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/class/input/input5
H: Handlers=mouse1 event5
B: EV=b
B: KEY=6420 0 70000 0 0 0 0 0 0 0 0
B: ABS=11000003

I: Bus=0011 Vendor=0002 Product=000a Version=0000
N: Name="TPPS/2 IBM TrackPoint"
P: Phys=synaptics-pt/serio0/input0
S: Sysfs=/class/input/input6
H: Handlers=mouse2 event6
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=3
[/code]

Le bon input pour le clavier usb est le 2, verifier avec la metode de Twistophe

Pour l’instant cela ne marche pas, soit je plante, soit je suis en tous claviers FR, soit en tous claviers SE.

J’ai un peu de tps devant moi je vais continuer mes tests :wink:
merci pour vos idées et aides si précieuse :slightly_smiling:

pas grand chose de nouveau pour l’instant, je vais aller me changer les idées :stuck_out_tongue:

Bon bilan, je n’ai pas réussi a faire ce que je voulais mais c’est pas grâve j’arrive au moin a changer entre les deux claviers, pour le coup d’un redémarage du serveur X il est vrai.hej

ce que j’ai fait,

j’ai créé 2 fichiers xorg.conf_FR et xorg.conf_SE l’un pour le layout en Suèdois et l’autre pour le FR.
ensuite je copie celui que je veux á la place du xorg.conf et je redémare la session X (Ctrl+Alt+Backspace)

Voilà

:arrow_right: Bon maintenant nouveau topic pour ma webcam :wink: