pimoroni / hyperpixel2r-python

MIT License
23 stars 10 forks source link

Touch not working in OS, similar to the HyperPixel 4.0 Touch #3

Closed sorryaboutyourcats closed 3 years ago

sorryaboutyourcats commented 3 years ago

I understand that the touch drivers are separated out, but is there anyway to, say, drag a window in Raspberry Pi OS using touch? Is it possible to use the HyperPixel 2.1 Round's touch functionality at an OS level, similar to how the HyperPixel 4.0 Touch works?

Thanks in advance.

Gadgetoid commented 3 years ago

Given that a kernel driver is completely out of my league, it should be possible to port over the original HyperPixel Python touch driver which injected touch events into uinput.

I am- honestly- pretty surprised that anyone would want to use Raspberry Pi OS on a 480x480 pixel circle, which is why I hadn't even attempted a Python touch driver. I clearly had a failure of imagination!

Gadgetoid commented 3 years ago

I've created an example you can try here: https://github.com/pimoroni/hyperpixel2r-python/pull/4

Install evdev:

sudo python3 -m pip install evdev

Then run with:

sudo python3 uinput-touch.py

Which should make touch work!

sorryaboutyourcats commented 3 years ago

Thank you so much for your quick response and help! [And sorry for the delayed response back... 😸]

I recently started using the HyperPixel touchscreens for interactive art projects being displayed at a gallery in Chicago. The one I'm actively working on now is a Kaleidoscope, with the shaft separated from the screen; the original idea was to have people tap the screen to go to the next video/image, though that won't be the case anymore.

Ah, back to the touch issue - I was able to get it running, so, much thanks! [The accuracy seems a bit off, but it works well for what I'm trying to do with it - for this project, it works perfectly.]

👍