From what I understand, earlier versions of the Synaptic driver in Ubuntu had an ‘absolute mode’ for the trackpad which allowed the user to access absolute coordinates as well as relative coordinates. However, Synaptic decided to remove it(not sure why) and its no longer available. Is there any way to access the absolute mode in Ubuntu 20.04 LTS? I’d like to be able to get these coordinates in a C/C++ program but open to any other solutions (Rust, shell script, whatever works). I’ve come across similar posts but I’m still unable to find a satisfactory solution. Most recommend the evtest driver which does sport absolute mode but lacks other features(2 finger scrolling, etc.). I’m thinking reverting back to an older version of the Synaptic driver might help but wanted to know what I’d be missing out on. I mean, are there any important features in the more recent Synaptic driver that the old one with absolute mode doesn’t?
I did a bit more digging and came across this page –> http://manpages.ubuntu.com/manpages/bionic/man1/python-evdev.1.html
It shows how to use a Python library, evdev, and how to use it to access system input events. Following the examples, I set it to watch my trackpad events and upon moving my finger I got a whole wall of information which unfortunately, I didn’t understand. I did notice terms like ABS_X, ABS_Y but couldn’t make anything of it. Regardless, it appears that I can access a lot of trackpad information through this library including something to do with absolute coordinates. How do I use this information? Can anyone show me how to write a simple Python function using evdev
def foo(): ... return (x,y)
where (x,y) represents my finger postion on the trackpad?
Edit 2: Sample output of evdev monitoring my trackpad.
Can any of this be used to get absolute coordinates?
absolute axis event at 1623586006.216310, ABS_MT_TRACKING_ID absolute axis event at 1623586006.216310, ABS_MT_POSITION_X absolute axis event at 1623586006.216310, ABS_MT_POSITION_Y absolute axis event at 1623586006.216310, ABS_MT_PRESSURE key event at 1623586006.216310, 330 (BTN_TOUCH), down absolute axis event at 1623586006.216310, ABS_X absolute axis event at 1623586006.216310, ABS_Y absolute axis event at 1623586006.216310, ABS_PRESSURE key event at 1623586006.216310, 325 (BTN_TOOL_FINGER), down synchronization event at 1623586006.216310, SYN_REPORT absolute axis event at 1623586006.231209, ABS_MT_PRESSURE absolute axis event at 1623586006.231209, ABS_PRESSURE