Tweaking the Logitech R400 presenter tool on Linux
This article is a updated version of an earlier one, which describes how to tweak the R400 on non-systemd systems.
In 2002, I received a Logitech R400 presenter tool for Christmas as a replacement for the php|architect pointer that has now fallen apart. However, to use it together with my presentation system—pres2, about which I previously wrote—I need it to provide left and right arrow keypresses. By default its left and right buttons generate Prior and Next events in X. It took me a while to get this to work, so in short, this article sets out how I changed it.
First of all, I editted the file /lib/udev/hwdb.d/60-keyboard.hwdb as root. I searched for R400 and changed its entry to:
# Logitech Presenter R400 keyboard:usb:v046DpC52Dd*dc*dsc*dp*ic*isc*ip*in00* KEYBOARD_KEY_070029=f11 KEYBOARD_KEY_07003e=f11 KEYBOARD_KEY_070037=f5 KEYBOARD_KEY_07004b=left KEYBOARD_KEY_07004e=right
This maps the two scan codes that the Play button (lower-left) generates to f11, the empty screen button to f5 and the left and right buttons to the left and right arrow keys.
The first column represents the scancode, which I obtained by first looking up with input event the device was tied to:
stat -t /dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd --printf "%N\n"
Which showed the following for me:
‘/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd’ -> ‘../event19’
To find out the scan codes, I had to download a getscancodes tool, and then compile it:
wget 'http://downloads.sourceforge.net/project/keytouch/getscancodes/getscancodes%201.0/getscancodes-1.0.tar.gz?r=http%3A%2F%2Fkeytouch.sourceforge.net%2Fdl-getscancodes.php&ts=1412723944&use_mirror=kent' -O getscancodes-1.0.tar.gz tar -xvzf getscancodes-1.0.tar.gz cd getscancodes/ make
With the new binary, and the event19 from above, I ran:
sudo ./getscancodes /dev/input/event19
Which showed:
458807 (0x70037) 458793 (0x70029) 458814 (0x7003e) 458827 (0x7004b) 458830 (0x7004e)
With these numbers, I now had enough information to edit the /lib/udev/hwdb.d/60-keyboard.hwdb file that I mentioned earlier.
After that, I had to run:
sudo udevadm hwdb --update
This consolidated the modified rules and made the keymapping active. My presenter tool now sends the correct key codes again.
The changes will persist after rebooting as well.
Comments
My 60-keyboard.hwdb had evdev:input:b0003v046DpC52D* in it. Did you have that before your edits or did you have keyboard:usb:v046DpC52Dd*dc*dsc*dp*ic*isc*ip*in00*
One other thing which may be of interest. My old presenter went walkies, and I bought a new one which looks the same, but its USB ID is 046d:c538, not 046d:c52d. You might want to make a note about this to help people who find your web page but don't understand the significance of the string in (either your or my version of) 60-keyboard.hwdb.
Cheers.
One other thing. I believe the politically correct thing to do is not to edit the file in /lib, but to put your definition in a file in /etc/udev/hwdb.d/60-keyboard.hwdb
I tried that and (after running udevadm hwdb --update as you say) it works on my system.
Q: if you have the image of the R400 visible on your screen and you look away a bit, does it look like Darth Vader to you? ;-)
Life Line
Little Owl owlet
This lovely owlet was quite easy to find in a London Park, with some help as they camouflage so well!
I saw its sibling too.
#BirdPhotography #BirdsOfFediverse #Photography #Nature #London #BirdsOfMastodon
I went to a park (Bushy Park) to look for some owls.
I found Owls (Little and Tawny), but also a Green Woodpecker and two Kingfishers.
Snaps from my camera screen, and real photos will follow, but not of the Kingfishers as they were too far away and the photos are blurry.
#london #BirdPhotogaphy #BirdsOfMastodon #Birds #photography #BirdsOfFediverse #BushyPark
I hiked 13.8km in 4h44m12s
Created a chocolate shop and a restaurant; Updated 6 restaurants and an address; Confirmed 5 restaurants, a community_centre, and 3 other objects
Created a restaurant, a fast_food, and 2 other objects; Deleted a restaurant
I walked 8.5km in 1h31m45s
Created 2 buildings and a hairdresser shop; Updated a restaurant and an estate_agent office; Confirmed a cafe
I walked 2.2km in 38m09s
Merged pull request #1096
Bump actions/checkout from 6 to 7
Merged pull request #1095
Improve Tiverton Green mapping
Created 2 gates
I walked 7.1km in 1h23m15s
I walked 1.0km in 9m24s
Realign streets. They now have much less wide corners into each other.
Updated a fast_food
I walked 9.1km in 1h35m41s
I hiked 4.7km in 3h24m10s
I walked 6.7km in 1h12m03s
I walked 7.7km in 1h47m24s
Updated a pub
Updated a pub
Created a bar; Updated a bar; Confirmed a restaurant and a bar




Shortlink
This article has a short URL available: https://drck.me/r400-b4d