amstan / guitar

MIDI Guitar(design, hardware, firmware, driver software)
7 stars 1 forks source link

Framework touchpad #5

Open amstan opened 2 years ago

amstan commented 2 years ago

I need some kind of input device for the strumming area.

For v2, a laptop touchpad was pretty good.

It would be good to be able to move to the framework touchpad.

The requirement here is to be able to access it rather low level from userspace. At least absolute coordinates for touch events of each of the fingers.

It would be good if it can be accessed using userspace i2c, that way I can even share the bus with the frets. I have a feeling the BIOS currently gobbles up a lot of it, at least based on my experience with PS/2 mouse emulation.

Bonus points if I can get the raw scan matrix before the blob algorithm happens. A custom algorithm to detect which string is affected will probably be better.

amstan commented 2 years ago
alex@alex-framework:~% sudo python                
Python 3.10.4 (main, May 14 2022, 05:21:19) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import evdev
>>> dev=evdev.InputDevice("/dev/input/by-path/pci-0000:00:15.3-platform-i2c_designware.2-event-mouse")
>>> a=dev.read_loop()
>>> while True: print(evdev.categorize(next(a)))
... 
absolute axis event at 1654412575.038789, ABS_MT_TRACKING_ID 
absolute axis event at 1654412575.038789, ABS_MT_POSITION_X 
absolute axis event at 1654412575.038789, ABS_MT_POSITION_Y 
key event at 1654412575.038789, 330 (BTN_TOUCH), down
key event at 1654412575.038789, 325 (BTN_TOOL_FINGER), down
absolute axis event at 1654412575.038789, ABS_X 
absolute axis event at 1654412575.038789, ABS_Y