Hello,

can you try using this?

import os
os.environ['SDL_VIDEODRIVER'] = 'windib'

before importing pygame.


cheers,


On Thu, Apr 28, 2011 at 11:01 AM, Witton, Caroline <c.wit...@aston.ac.uk>wrote:

>  Windows XP at the moment - though I will try and get it upgraded to
> Windows 7, especially if that might make a difference
>
> Best wishes
>
> Caroline
>
>
>
>
>
> *Dr Caroline Witton**
> Reader in Neuroscience*
>
> *Manager, Wellcome Trust Lab for MEG Studies*
>
>
> 0121 204 4087 .
> c.wit...@aston.ac.uk
>
> Students can make an appointment to see me here:
> https://wass.aston.ac.uk/wass
>
> *P** **Please consider the environment before printing this e-mail*
>
>
>
> *From:* owner-pygame-us...@seul.org [mailto:owner-pygame-us...@seul.org] *On
> Behalf Of *René Dudfield
> *Sent:* 28 April 2011 10:58
> *To:* pygame-users@seul.org
> *Subject:* Re: [pygame] touchscreen laptops with pygame
>
>
>
> Hi,
>
> what version of windows are you using?
>
> cheers,
>
> On Thu, Apr 28, 2011 at 10:49 AM, Witton, Caroline <c.wit...@aston.ac.uk>
> wrote:
>
> Dear pygame-users,
>
>
>
> I’m writing some basic pygame programs for use in a research study with
> children in schools and I would like to start using a touchscreen laptop
> with them.  My code works fine with a standard mouse but I’m getting strange
> errors when I try with a touchscreen monitor – I would be grateful for any
> advice at all.
>
>
>
> The problem is that the mouse position co-ordinates I get from the
> touchscreen don’t bear any relation to what I get with a standard mouse.
> Its a USB HID touchscreen so I had expected it to act like a mouse with one
> button.  But, for example, the following section of code prints appropriate
> mouse co-ordinates if I click the ‘normal’ mouse, but strange (meaningless?)
> co-ordinates if I touch the touchscreen, even though the mousemotion and
> mouse button events are identified as the correct type.
>
>
>
> for event in pygame.event.get():
>
>             print pygame.event.event_name(event.type)
>
>             if event.type==MOUSEBUTTONDOWN:
>
>                 print event.pos
>
>
>
> My display is set up simply like this: windowSurface =
> pygame.display.set_mode((0, 0), pygame.RESIZABLE, 32)  ... and I’m working
> in Windows for this project. I’ve already tried updating my drivers and my
> version of directX, and have calibrated the touchscreen using the software
> provided with the laptop – it works fine for other programs.
>
>
>
> I’m not an expert programmer so would be grateful for any advice – is there
> something I have missed about setting the display, or about using two input
> devices?  I’m really stuck!
>
>
>
> Any advice gratefully received – many thanks,
>
> Caroline
>
>
>

Reply via email to