Hi,
I am using a Raspberry Pi 3B+ running with Full Buster Raspbian. The display itself works fine. I have Raspi-Config set to boot to the CLI and NOT load X-Windows. When this happens and I run my python3 (3.7) program which uses pygame to get the mouse coordinates, pygame.mouse.get_position() (display set_mode to 800x480), the calibration is way off. Now, when I run StartX, it loads x-windows and the mouse via the touchscreen works fin (calibration fine)... and when I click on the terminal and THEN run my python3 pygame program, the touchscreen is calibrated then also..... but... if I just boot to the CLI directly and run my program, the touchscreen calibration is off. Clearly running StartX somehow uses a driver that the CLI isn't, and that driver remains running if I run my program in a terminal window.
I've researched a long time on the Net, and tried all kinds of solutions from others, and nothing seems to work. Pygame is based on SDL. I read that I need to change it so that Pygame uses something called FTSDL or something like that (darnit didn't write it down) that treats the touchscreen differently. However, the instructions for that involve editing text in various configuration files and that text isn't there at all on my system - and I suspect that these instructions worked or were necessary prior to the touchscreen being integrated into the OS some time ago. So I'm not sure where that leaves me.
I am sorry if I've not included something here or what-have-you. This is my first question in a forum in many years and my first on the Pi/Touchscreen. I'm a programmer for a living and an electronics designer. I'm sure I'm just missing something obvious but not sure how to get from here to there...
Thank you for your time.
Cheers,
Jeff