1

I've got a fullscreen pygame app being run on boot, and it looks like the touch coords it gets immediately after boot are bad.

pos = pygame.mouse.get_pos()

For instance, if I touch in the center of the screen, it appears to treat that as 0,0. As if that was the top left corner of the screen, and touching down or right of that point gives coordinates relative to that first touch.

But touching above or left of that point seems to reset the origin to that point.

If I start by taking my finger at the top left, and swiping diagonally down to the bottom right, that appears to "calibrate" the screen and all touch coordinates are correct after that.

Has anyone else seen this behavior? Any tips or ideas?

The only thing I can think is maybe it's because I'm having the app start up pretty early in the boot sequence, before gnome even. (I'm running Raspbian latest, all updated)

  • Did you look at the replies to this question – jogco Jul 26 '16 at 17:43
  • They don't immediately address the issue as they are specific to another touch screen. They might be able to be adapted to this screen but I don't know enough about this screens drivers and such to do it yet. – Adam Jul 27 '16 at 18:59
  • is your touchscreen calibrated in the first place? – Dmitry Grigoryev May 15 at 13:17
1

I had the same problems with Stretch (Desktop) and pi3. My solution: Not to use pygame for the touch.

Take this instead: python-multitouch

Works very good with very less changes in the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.