-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touchscreen Problems #432
Comments
Hi @h0d3nt3uf3l thanks for feedback and big fixing. The pi3d mouse location is rather messy as it has adopted functionality from lots of different bits of software which has to be specified on start up. The original RPi worked well without desktop but had to get mouse input using fairly low level IO. Later, with an x11 desktop, or tk, sdl2 etc there ended up with more mechanisms. I'm away from home at the moment but will have a look at this when I get home. |
@h0d3nt3uf3l just had a quick look at this. The Your question about display resolution bisection: do you mean why does position_x have half the display width subtracted (and the y have half the height added)? The reason is related to the fact that the pi3d coordinates are based on OpenGL 3D vectors where |
@paddywwoof thanks for this explanation. Now I have a hint for a misbehaviour which is still present with my touchscreen. Do I understand you right that in OpenGL logic, the middle of the display (e.g. 1920 / 2 and 1080 / 2) is point (0, 0, 1)? |
@h0d3nt3uf3l TL;DR yes. The longer answer is that there is vector math that takes a projection of the vertices representing polygons in 3D, as if viewed from the point of view of the camera, scales them for perspective and only renders the nearest ones to the camera. Obviously, for rendering a single quad for picframe, that's all a lot more complicated than is really needed. Also, within OpenGL texture lookup (i.e. UV coordinates) the origin is in the top left corner and for fragment sampling (i.e. pixels from a render) the origin is bottom left (I think, from memory). |
@paddywwoof yeah, just read about the opengl coordinate systems, the different spaces for them and transformation from 3D to the screen. Will do some changes on my code these days and try to get the touch screen work properly. |
@h0d3nt3uf3l there is almost certainly stuff that needs to be tidied (aka fixed) in the SDL2 mouse and keyboard code for in pi3d. I don't think that your patch of making the This is set https://github.com/tipam/pi3d/blob/df0cc84aebc56fb8d62e2517aeb48e59da689681/src/pi3d/Mouse.py#L56 which means that for it to be And the mouse is initialised here
restrict to be False , __input_type must not be "mouse", and presumably you set it as "touch", so that makes sense... But maybe it needs to operate differently if you had to tweak your code as you did.
|
Hi, yesterday I intalled the picframe and want to use it as "screensaver" for my HomeAssistant panel in the living room.
Hardware:
I'm using a RPI4 with Raspberry Pi OS (64-bit, Released: 2024-11-19). It's using Wayland with labwc as compositor.
Attached is a Iiyama North America PL2453MT in Portrait-Mode (works ot of the box with the rotation made on the Desktop, the touch function was rotated as well)
I was looking at the code today to get the touchscreen running. A few clicks did some things but it was never predictable.
I found out, that the mouse-postition and touch-position of the pointer where different and the touch position implausible as well (e.g. x= -23403, y= -2233)
That's because in pi3d.display Line 351 is delivering other values. I don't know it for sure, but I guess pi3d is broken on this point...
Btw. don't find where _mouse_relative is set for sure..
I'm not deep enough in that code to do some pull requests, but maybe I can help you with my findings.
It works for me with followed changed lines:
Greetings
P.s. Maybe you could tell me why there is always a bisection of the display resolution... I don't get it :)
The text was updated successfully, but these errors were encountered: