[clug] how to configure a second keyboard

Eyal Lebedinsky eyal at eyal.emu.id.au
Sun Nov 11 08:40:44 GMT 2007


Andrew

A simple script can search for the device:

for f in /sys/bus/usb/devices/*/idVendor ; do
	d="`dirname $f`"
	test "04b4:0100" = "`cat $f`:`cat $d/idProduct`" && \
		echo `basename $d`
done

Which says:
	7-3.1.4
and I should now be able to pick the correct /dev/input devices.


But the main question remains: how do I configure this keyboard differently
than the main one?

Eyal

Andrew Janke wrote:
> Hi Eyal,
> 
> As far as I am aware there is no unique ID in most keyboards (beyond
> the manufacturer ID). Could you put one in a USB port and the other in
> a PS/2 port?
> 
> Not the best solution but should work.
> 
> 
> a
> 
> On Nov 11, 2007 6:21 PM, Eyal Lebedinsky <eyal at eyal.emu.id.au> wrote:
>> I looked at this too. Simply replugging in a another usb port changes
>> the usb device name:
>>
>> lrwxrwxrwx 1 root root 9 2007-11-11 16:18 pci-0000:00:1d.7-usb-0:3.1.3:1.0- -> ../mouse2
>> lrwxrwxrwx 1 root root 9 2007-11-11 16:18 pci-0000:00:1d.7-usb-0:3.1.3:1.0-event- -> ../event3
>>
>> lrwxrwxrwx 1 root root 9 2007-11-11 18:15 pci-0000:00:1d.7-usb-0:3.1.4:1.0- -> ../mouse2
>> lrwxrwxrwx 1 root root 9 2007-11-11 18:15 pci-0000:00:1d.7-usb-0:3.1.4:1.0-event- -> ../event3
>>
>> The mouse name remained in this case, but will probably change when
>> other devices are plugged, or the order is changed.
>>
>> Eyal
>>
>> Carlo Hämäläinen wrote:
>>> On Nov 11, 2007 5:52 PM, Eyal Lebedinsky <eyal at eyal.emu.id.au> wrote:
>>>> How to I tell linux that one keyboard has a different keymap? I do not even
>>>> know how to call the keyboard because the /dev/input/{mouseX,eventX} change
>>>> based on the order of plugging devices in.
>>> Not sure about your main question, but /dev/input/by-path has symlinks
>>> to /dev/input/mouseX names. For example on my laptop I have
>>>
>>>  /dev/input/by-path/platform-i8042-serio-1-mouse -> ../mouse1
>>>
>>> So you might be able to get to your USB keyboard by a constant name.
>>>
>>> -- Carlo
>>>
>>> p.s. /dev/disk/by-id   has symlinks with unique names for USB disks,
>>> very handy for making a drive always go to a certain mount point, for
>>> example.
>>
>> --
>> Eyal Lebedinsky (eyal at eyal.emu.id.au)

-- 
Eyal Lebedinsky	(eyal at eyal.emu.id.au)


More information about the linux mailing list