jahnf / Projecteur

Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
MIT License
379 stars 33 forks source link

Feature Request: new USB device option (generic mouse, trackpoint) #61

Closed fmuelle4711 closed 4 years ago

fmuelle4711 commented 4 years ago

Hi!

I've made it work with an arbitrary mouse by adding a "device" option. Works for an IBM wheel mouse but more significantly for my trackpoint on a Thinkpad. I can used the touchpad as a regular mouse and the trackpoint as spotlight. Should work with USB mouse as well, patch attached.

It would be great if you included it in the next release. Code could be cleaned up, I know :-)

/lib/udev/rules.d/55-spotlight.rules:

IBM mouse

SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b3", ATTRS{idProduct}=="310c", MODE="0660", TAG+="uaccess"

trackpoint

SUBSYSTEMS=="input", ATTRS{name}=="TrackPoint", MODE="0660", TAG+="uaccess"

You can get trackpoint info from /proc/bus/input/devices, but this will likely work for anyone. For my trackpoint: ./projecteur -D 02:0a:0 For my USB mouse: ./projecteur -D 04b3:310c:0

BTW, I wonder if the uinput branch could be used to forward /dev/input/event* > /dev/uinput ?

Nice project, keep it up!

Frank projecteur-device-patch.txt

jahnf commented 4 years ago

Thank you. I will have a look and see how to integrate it. My next things on the TODO list for this project will be merging the uinput-branch and add a more generic way to support different devices (where also your input comes in)

jahnf commented 4 years ago

@fmuelle4711 Integrated your changes. Feedback is appreciated.

Although for devices that are added at runtime via the new -D command line option, it will be up to the user to make sure that device is accessible (via a udev rule). It is now also possible to add multiple devices via command line that are going to be accepted as supported device by Projecteur, e.g. projecteur -D 0123:3210 -D 0xabcd:0x1234

Also works in combination with the -d device scan option.