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
In more info innocent times, the hat riots caused some spankings...
100 Years Ago Men and Boys Fought on the Streets of New York Over Wearing Straw Hats Past Summer | The New York Public Library
https://www.nypl.org/blog/2022/09/23/straw-hat-riots-nyc📷 Mushroom Village
🚩 Weg van den Prins Willemsberg, Ellecom, Nederland
I walked 2.4km in 59m34s
📷 National Cycle Network 6
🚩 Watford, United Kingdom
I walked 7.6km in 1h54m50s
📷 Tufted Duck Pair
🚩 Outer Circle, City of Westminster, United Kingdom
RE: https://phpc.social/@Xdebug/115662135830755552
I have just released Xdebug 3.5.0!
In the next few weeks I will create some content (text, and perhaps video) highlighting some new features in more detail.
Please share it with the world!
The master branch is now for Xdebug 3.6, targetting PHP 8.6
Back to -dev
Tweak release instructions a little
Go with 3.5.0
Tweak message IDs and severities for control socket log entries
I walked 8.1km in 1h26m40s
I walked 1.1km in 9m28s
I walked 8.5km in 1h30m56s
My whisky of the month for December 2025, is a 15yo Aultmore bottled by Cadenhead's.
Fixed off-by-one error in address length name for control socket on L…
Merged pull request #1050
Fixed control socket name by removing silly trailing things (by not p…
RE: https://en.osm.town/@harry_wood/115650834037247679
Fancy a friendly #OpenStreetMap chat in the pub, with some Christmas celebrations?
The London OSM gang is meeting on December 16th near Paddington.




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