Linux evdev-libmapper bindings

8 views
Skip to first unread message

Travis West

unread,
Jan 26, 2022, 8:16:28 AM1/26/22
to dot_m...@googlegroups.com
Hi all,

I hacked together a very simple binding for linux evdev to libmapper by injecting some libmapper calls into the evtest program that comes with most distributions. This should allow any device with linux evdev drivers (which includes basically every game controller, joy stick, graphics tablet, mouse, keyboard, hid, etc. device ever?) to connect to libmapper.

At this point it's just a very simple hack, but it shows so much promise I thought I would share. I've tested it with a Wacom tablet, and am looking forward to hooking up my game controllers soon. Open to hearing ideas and contributions.

Compile with the usual `./autogen.sh; ./configure; make`. You will probably have to run the binary as root to have permission to open the device files directly. And of course, it's linux only. I guess it would probably work fine if you pass a bluetooth or USB device to a virtual machine? And it should work on an SBC like a Raspberry Pi as well.

There are tons of old Wacom tablets at IDMIL that could be revived with this.

TW

PS apologies for cross-posting, anyone who is subscribed to both dot_mapper and the IDMIL list.

Travis West

unread,
Jan 26, 2022, 8:16:55 AM1/26/22
to dot_m...@googlegroups.com

Edu Meneses

unread,
Jan 26, 2022, 8:49:28 AM1/26/22
to dot_m...@googlegroups.com
Hello everyone,

This looks promising indeed. I have some PS4 controllers lying around. I'll try it as soon as I can.

Personal question on the repo organization: are the files inherited from evtest linked to the original repo? I see old dates (7 years ago) and evtest collaborators linked to your repo, but no clone/fork indication.

Cheers,

Edu Meneses
McGill University | Ph.D. Researcher
Input Devices and Music Interaction Laboratory | IDMIL
Centre for Interdisciplinary Research in Music Media and Technology | CIRMMT


--
You received this message because you are subscribed to the Google Groups "dot_mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dot_mapper+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dot_mapper/CAGAPLr%3DGQA6MzgjAcnia3ZJuXYy4VSkkf8frPZ%2B8kCf5ONJcqQ%40mail.gmail.com.

Travis West

unread,
Jan 26, 2022, 11:58:27 AM1/26/22
to dot_m...@googlegroups.com
Yes, I forked it from the freedesktop gitlab evtest repository linked in the readme. I guess there is no fork indicator since its across git platforms.

TW

Joseph Malloch

unread,
Jan 27, 2022, 8:16:56 AM1/27/22
to dot_m...@googlegroups.com
Hi Travis – this looks great!

When I was hacking on the HID->libmapper bridge long ago I realized that declaring a computer keyboard as a mappable device creates a rather large security hole since another libmapper device could log passwords or other sensitive information. I recommend making the software default to excluding keyboards, and only including them if the user passes a —include-keyboards flag when starting the program.

Cheers,
Joe

Travis West

unread,
Jan 27, 2022, 10:29:58 PM1/27/22
to dot_m...@googlegroups.com
Hey Joe.

Good point! Right now you already have to deliberately choose your keyboard to expose it to the network, either by passing its device file as an argument or by selecting it from a list, so the "opt in" step is in place. Best to make sure it stays there!

I will add a note to the readme about the security implications of binding devices to the network in this way, and maybe print a message when the program starts too. 👍.

TW

Reply all
Reply to author
Forward
0 new messages