User:Ned Scott/Sandbox: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Now we write a new rules file for udev: | |||
nano /etc/udev/rules.d/10-irremote.rules | |||
and put the following content in: | |||
<pre> | |||
SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:68",SYMLINK="input/irremote0" | |||
SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:69",SYMLINK="input/irremote1" | |||
</pre> | |||
'''Note the numbers for ''idVendor'' and ''idProduct'' are the numbers we got from /proc/bus/input/devices.''' | |||
Alternatively, you can avoid relying on specific minor numbers with: | |||
<pre> | <pre> | ||
. | KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",IMPORT{program}="input_id %p" | ||
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_KEYBOARD}=="1",SYMLINK="input/irremote0" | |||
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_MOUSE}=="1",SYMLINK="input/irremote1" | |||
</pre> | |||
Note that without the KERNEL match irremote1 is attached to a device sometimes which seems to be an inappropriate ioctl device (no event but only mouse). | |||
Now restart udev and trigger a new discovery: | |||
restart udev #notice for Gentoo: rc-service udev restart | |||
udevadm trigger | |||
(Restarting udev is optional at least as of Ubuntu lucid, and likely others.) | |||
Under /dev/input should now be two more symlinks: irremote0 and irremote1: | |||
ls /dev/input | |||
Revision as of 23:33, 29 April 2016
Now we write a new rules file for udev:
nano /etc/udev/rules.d/10-irremote.rules
and put the following content in:
SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:68",SYMLINK="input/irremote0" SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ATTR{dev}=="13:69",SYMLINK="input/irremote1"
Note the numbers for idVendor and idProduct are the numbers we got from /proc/bus/input/devices.
Alternatively, you can avoid relying on specific minor numbers with:
KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",IMPORT{program}="input_id %p" KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_KEYBOARD}=="1",SYMLINK="input/irremote0" KERNEL=="event*",SUBSYSTEM=="input",ATTRS{idVendor}=="05a4",ATTRS{idProduct}=="9881",ENV{ID_INPUT_MOUSE}=="1",SYMLINK="input/irremote1"
Note that without the KERNEL match irremote1 is attached to a device sometimes which seems to be an inappropriate ioctl device (no event but only mouse).
Now restart udev and trigger a new discovery:
restart udev #notice for Gentoo: rc-service udev restart udevadm trigger
(Restarting udev is optional at least as of Ubuntu lucid, and likely others.)
Under /dev/input should now be two more symlinks: irremote0 and irremote1:
ls /dev/input