8ca379fa134a3d57a057f0775a122069c668244a
Device Drivers
This repository contains Linux kernel modules (.ko) that implement low-level USB input drivers and expose device events through the Linux input subsystem (evdev).
A helper tool (usb_driver_manager.py) is included to make it easier to:
- list USB devices and their interfaces
- load/unload (reload) a chosen
.komodule - unbind/bind a selected interface to a chosen driver during development
Drivers
Mouse driver (mouse/)
USB HID boot-protocol mouse driver.
Build:
cd mouse
make
Logitech G29 media driver (g29_media_usb/)
Logitech G29 driver that maps selected wheel inputs to media key events.
Current mapping (Mode 0):
- Red rotary clockwise / counter-clockwise -> Volume Up / Volume Down
- Return ("Enter") -> Play/Pause
- Plus / Minus -> Next track / Previous track
Build:
cd g29_media_usb
make
After building, the module (*.ko) is typically placed under build/ by the provided Makefiles.
USB Driver Manager
Usage examples:
# Search for modules in these driver directories (the tool searches recursively)
sudo python3 usb_driver_manager.py ./mouse ./g29_media_usb
# Or point directly at build/ directories
sudo python3 usb_driver_manager.py ./mouse/build ./g29_media_usb/build
Workflow:
- Select the USB device.
- (Optional but recommended for non-mouse devices) select the USB interface to bind.
- Select the kernel module.
- Confirm; the tool unbinds the current driver, reloads the module if needed, and binds the chosen interface.
Testing
After binding the driver, use evtest to confirm key events:
sudo evtest
Description
Languages
C
60.2%
Python
37.2%
Makefile
2.6%