Fortunate for me, they have different product ID (by "cat /proc/bus/input/devices") so I can create a udev rule to produce two different device nodes. (Update: even if both devices have the same product ID, one can still distinguish them according to their USB port addresses)
/etc/udev/rules.d/60-dell-keyboards.rules
# /etc/udev/rules.d/60-dell-keyboards.rules
# udev rules for dell keyboards.
# This solves the problem of the same /dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd problem while I need to distinguish the two Dell Keyboards
# ref: http://reactivated.net/writing_udev_rules.html
# ref: http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Fixed_device_files_with_udev
KERNEL!="event[0-9]*", GOTO="dell_key_end"
# Port specific link for users of multiple keyboards of the same type.
# The ID_PATH variable is set by the "path_id" script in an earlier rule file.
ATTRS{idVendor}=="413c", ENV{ID_PATH}=="?*", SYMLINK="input/by-path/$env{ID_PATH}-dell"
# Type-named links for multiple keyboards
ATTRS{idVendor}=="413c", ATTRS{idProduct}=="2003", SYMLINK+="input/dell_keyboard_2003"
ATTRS{idVendor}=="413c", ATTRS{idProduct}=="2105", SYMLINK+="input/dell_keyboard_2105"
LABEL="dell_key_end"
No comments:
Post a Comment