nlrb
Posts: 6
Joined: Mon Apr 13, 2015 7:50 pm

Mouse driver problem

Sat Oct 03, 2015 7:47 pm

When using the touchscreen with X Windows the positioning is accurate (i.e. cursor shown where the screen is touched). I guess this uses the event device.

However, when using the mouse device the positioning is quite erratic and not accurate. Below example code using pygame.

Code: Select all

import sys, pygame, time
from pygame.locals import *
pygame.init()

size = width, height = 800, 480
screen = pygame.display.set_mode(size, pygame.FULLSCREEN)

while True:
	for event in pygame.event.get():
		if event.type == pygame.MOUSEBUTTONDOWN:
			pygame.display.update()
		if event.type == KEYDOWN:
			if event.key == K_ESCAPE:
				sys.exit()

	time.sleep(0.1)
BTW: I used this code with the PiTFT and that worked well.

Do others experience the same? Or is something else going on? Any remedy?

nlrb
Posts: 6
Joined: Mon Apr 13, 2015 7:50 pm

Re: Mouse driver problem

Wed Oct 07, 2015 7:37 pm

Has anybody been able to try the above code? And does it give the same result as for me?

markmagness
Posts: 7
Joined: Tue Dec 23, 2014 2:44 pm

Re: Mouse driver problem

Tue Oct 20, 2015 10:58 am

I'm also having this issue with the official touchscreen and pygame, the pointer position does not match up with my finger position. How do we fix?

gadgetoid
Posts: 152
Joined: Wed Mar 07, 2012 9:58 pm

Re: Mouse driver problem

Wed Oct 21, 2015 1:53 pm

This is an extreme work in progress, but this library and example show 10 point multitouch working in PyGame and it seems pretty accurate ( although hitting pixel 799,479 with my finger is proving to be difficult! )

https://github.com/pimoroni/python-multitouch

nlrb
Posts: 6
Joined: Mon Apr 13, 2015 7:50 pm

Re: Mouse driver problem

Wed Oct 21, 2015 5:06 pm

@markmagness: thanks for confirming it is a generic issue!

@gadgetoid: thanks for providing the workaround via the event interface. However, I don't need multi-touch - I'd just want the mouse interface to work properly. Does anyone have a pointer to how to fix that?

Return to “Official Foundation Display”