Re: [pygame] BUG: Different events when I enable OpenGL
I see, I'll let the libsdl folks know, and see what they think about that. The get_mouse thing might work for teh stylus, but not for multi-touch :( Is there a way to inject code, or attach handlers to the actual underlying system window (instead of teh SDL abstraction) from python? SDL must handle the windows mesage somewhere, but I dont know if that is accessible at all through python. i tried using win32 hooks, but I cant inject python code (the code has to be in a dll). I dont really want to change the code in C/C++, because it would require user to compile a custom version. -- Thomas -- Thomas On Sat, Nov 21, 2009 at 2:50 AM, René Dudfield wrote: > hi, > > opengl uses a slighty different video and event driver. So that > explains the different behaviour. > > probably have a better chance of it getting fixed if you report your > bug here: bugzilla.libsdl.org > > I'm guessing that the stylus uses a different method of updating the > mouse position... and the opengl method of getting events is not > working. > > Maybe a work around would be to use pygame.mouse.get_pos() ? > > > cu, > > > On Sat, Nov 21, 2009 at 6:27 AM, Thomas Hansen > wrote: >> If I enable OpenGL on my display, teh evebnt system starts behaving >> differntly. >> The following code prints all the events I am interrested in if i do >> not >> enable OpenGL. If I enable it however, events from the touchscreen >> and stylus >> are not reaching the event queue. >> >> Note that this also happens for the simulated mouse events that >> windows >> generates for these input devices. When I dont enable OpenGL, and just >> get the >> normal mouse events (no fancy windows touchwindow, or using >> pymt.SYWMEVENT), >> everything is fine. If I enable OpenGL however, mouse events are not >> generated >> when I use touch or stylus (although they move/controll the system >> mouse >> cursor) >> >> I am using pygame 1.9.1 with Python 2.6.2 on Windows 7. >> >> >> import pygame >> import ctypes >> >> #if I uncomment this line, the window does not produce teh same events >> #without it it works just fine!! >> #display_flag = pygame.OPENGL >> >> pygame.display.quit() >> pygame.display.init() >> pygame.display.set_mode((320, 240) display_flag) >> pygame.event.set_allowed(pygame.SYSWMEVENT) >> >> pygame.display.set_caption('pymt') >> hwnd = ctypes.windll.user32.FindWindowA(None, "pymt") >> ctypes.windll.user32.RegisterTouchWindow(hwnd, 0) >> >> while True: >> for event in pygame.event.get(): >> if event.type == pygame.SYSWMEVENT: >> print event >> >
[pygame] BUG: Different events when I enable OpenGL
If I enable OpenGL on my display, teh evebnt system starts behaving differntly. The following code prints all the events I am interrested in if i do not enable OpenGL. If I enable it however, events from the touchscreen and stylus are not reaching the event queue. Note that this also happens for the simulated mouse events that windows generates for these input devices. When I dont enable OpenGL, and just get the normal mouse events (no fancy windows touchwindow, or using pymt.SYWMEVENT), everything is fine. If I enable OpenGL however, mouse events are not generated when I use touch or stylus (although they move/controll the system mouse cursor) I am using pygame 1.9.1 with Python 2.6.2 on Windows 7. import pygame import ctypes #if I uncomment this line, the window does not produce teh same events #without it it works just fine!! #display_flag = pygame.OPENGL pygame.display.quit() pygame.display.init() pygame.display.set_mode((320, 240) display_flag) pygame.event.set_allowed(pygame.SYSWMEVENT) pygame.display.set_caption('pymt') hwnd = ctypes.windll.user32.FindWindowA(None, "pymt") ctypes.windll.user32.RegisterTouchWindow(hwnd, 0) while True: for event in pygame.event.get(): if event.type == pygame.SYSWMEVENT: print event
[pygame] Re: Multiple mice on windows
Hey Oscar! great work. this is a really cool feature and your code seem to work fine. I am having trouble however trying to integrate the code you had with pyglet. I know this is a pygame mailing list, and maybe you dont know anything about pyglet. but i am trying to add multi-mouse support to an application i have already written in pyglet. If I instantiate your rawinputreader. pyglet's main EventLoop throws an exception as soon as I move any of the mice. If you have any idea why this might be happpening I'd appreciate some input. Here is the traceback I am getting (I am just instantiating the rawinputreader and a pyglet window). If I dont instatiate the rawinputreader everything works fine. Traceback (most recent call last): File "C:\Documents and Settings\Thomas Hansen\workspace\multipoint \src\test.py", line 73, in rawEventLoop().run() File "C:\Python25\Lib\site-packages\pyglet\app\win32.py", line 67, in run _user32.DispatchMessageW(ctypes.byref(msg)) WindowsError: exception: priviledged instruction On Jun 12, 5:35 pm, "Oscar Lindberg" <[EMAIL PROTECTED]> wrote: > Hi, > > I just uploaded an early beta of something I've been fiddling around with on > Windows: > > http://pymultimouse.googlecode.com/files/pymultimouse0.1.zip > > If you download it and run the pygamedemo.py, you will see an empty screen. > When you start moving around all you mice connected to the computer, each > mouse gets a mouse pointer of its own. > > I would be happy if you guys could try it out and give me some feedback. I'm > hoping to hide most of the raw input details some time in the future, to be > able to keep the same API between platforms. I would also like to make it > work more "pygame-like", using the standard events and so on. > > It requires the win32con package (and pygame for the demo). And python of > course. > > Regards, > Oscar Lindberg