Got Touchpad Emulator working on my #Xiaomi Pad 5 Pro running #postmarketOS! It is odd in that the volume up and down keys are on two different input devices so I had to do some refactoring to handle that. Also the touchscreen emits different events for some reason and it emits them in a slightly different order than on other devices I've used Touchpad Emulator with, so I had to make a workaround for that. I think that workaround messed with scroll wheel emulation, a problem for tomorrow.
=> More informations about this toot | More toots from CalcProgrammer1@mastodon.social
https://gitlab.com/CalcProgrammer1/TouchpadEmulator
It turns your device's touchscreen into a mouse. Toggles between mouse and touchscreen mode using volume keys or slider (on OnePlus 6T) and also toggles onscreen keyboard enabled/disabled.
=> More informations about this toot | More toots from CalcProgrammer1@mastodon.social
Added LG Google Nexus 5 as well and tested it works. My Samsung phones need to be reinstalled as the version of postmarketOS on them is ancient, and I have the kernel flashed to recovery with the rootfs on SD card which I don't think is compatible with lk2nd, so I'll investigate those later.
=> More informations about this toot | More toots from CalcProgrammer1@mastodon.social
@CalcProgrammer1 Instead of hardcoding the input devices could you iterate over all available ones and query which provide the required keys (vol down, vol up, touch) and poll those then?
I tried it on my device but quickly gave up because I didn't want to hardcode yet another set of paths.
=> More informations about this toot | More toots from z3ntu@fosstodon.org
@z3ntu I'm not sure how to poll a device on what input events it could return without having you manually click the buttons every time it starts up. Do you know how to do this?
I just added two more devices - Google Pixel 3a (google-sargo) and Xiaomi Poco F1 (xiaomi-beryllium) and tested it works on both.
So far the supported devices are:
=> More informations about this toot | More toots from CalcProgrammer1@mastodon.social
@z3ntu I also should go back and add my old devices - Nexus 5 (lg-hammerhead), Samsung Galaxy S5 (samsung-klte), and Samsung Galaxy Note 3 (samsung-hlte).
=> More informations about this toot | More toots from CalcProgrammer1@mastodon.social
@z3ntu Based on quick google search, getevent -p
I will investigate this further. I agree it would be nice to be able to determine events automatically.
=> More informations about this toot | More toots from CalcProgrammer1@mastodon.social
@CalcProgrammer1 Also if you launch e.g. evtest you can see what events the device provides. Just filter on those I'd say
$ evtest /dev/input/event2
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 115 (KEY_VOLUMEUP)
Event type 5 (EV_SW)
Event code 0 (SW_LID) state 0
Properties:
Testing ... (interrupt to exit)
=> More informations about this toot | More toots from z3ntu@fosstodon.org
@CalcProgrammer1 Also any application handling input is probably doing the same, taking all input devices, filtering based on what they provide and then polling them. So there should be plenty example on the internet I'd imagine.
=> More informations about this toot | More toots from z3ntu@fosstodon.org
@z3ntu I've implemented automatic device detection using the capabilities detection check from evtest.c. It's used as a fallback if none of the named devices work. It picks the first device that has all the capabilities for the desired function (volume up, volume down, touchscreen) so there is a potential issue if there are multiple devices that match (such as a keyboard with volume keys) but the built in devices should be first I think. That's why I made this a fallback though.
=> More informations about this toot | More toots from CalcProgrammer1@mastodon.social This content has been proxied by September (3851b).Proxy Information
text/gemini