[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] BUG: virtual input mode seems all broken on my Vista machine on 1.8.0
- To: pygame-users@xxxxxxxx
- Subject: [pygame] BUG: virtual input mode seems all broken on my Vista machine on 1.8.0
- From: "Brian Fisher" <brian@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 22 May 2008 00:20:53 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 22 May 2008 03:20:59 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=J2QcxRIZXtJ19JuXn6UPru3DCr9IAbe5fQdLDAPs4+Q=; b=sXqzsotc2yZHJ93L+TSWezZG0cEBR6c56I/55VRYM9W4mhK71T6K7RxWKKW+CqaMoL+9lrORV7kAA5Rol9OBlT4ReNV13hIUtAvZpTAuSI2r4mRC0ULnD2oXp/N70DAZe8qAEtrPin/Pd8/NOeu7l/tI1/Ze8pcenyci3VcuWOM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=YC+MghbMBgbQK2cJdxlJhPv5Pz07TjVnhPyz3zLw2Ttm2byZAFt5zN3dPgsJu6r4j80OorWc0PC/jvKVzHiNuzHF4gnXGDPZYvKfooD2aOJVQRMVmz5K5eUX15izeFRi+kFpH/id3Rg3bDk688OKe4mZGkPpYBxUxJbklznEdH4=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I haven't tried pygame 1.7 and I haven't tried on other machines yet, but with pygame 1.8.0release on my vista machine, anytime the mouse is in virtual input mode (mouse grabbed and cursor hidden, or fullscreen and cursor hidden) mouse control gets screwy on my Vista machine (seems to get shoved to the screen edges a lot) - oddly enough though, the mouse doesn't get screwy until a key message is processed...
Attached is a test script - with it everything seems fine at first, until a key is pressed, then it goes bad. You can switch fullscreen, mouse grab and mouse visible with the f, g and m keys respectively to see that the screwiness is tied to cases where virtual mouse input is on.
I'm curious if this happens for anybody else, on other OS's, so if you try it out, please let me know if you see the same problems.
import pygame
print pygame.version.ver
grab_mouse = True
mouse_visible = False
full_screen = False
pygame.display.init()
screen = pygame.display.set_mode((640,480))
pygame.event.set_grab(grab_mouse)
pygame.mouse.set_visible(mouse_visible)
pygame.font.init()
def_font = pygame.font.Font(None, 24)
while 1:
status_text = "grab (g to toggle): "
if grab_mouse:
status_text += "ON"
else:
status_text += "OFF"
status_text += " mouse (m to toggle): "
if mouse_visible:
status_text += "Visible"
else:
status_text += "Hidden"
status_text += " fullscreen (f to toggle): "
if mouse_visible:
status_text += "YES"
else:
status_text += "NO"
text_surface = def_font.render(status_text, True, (128,196,255), (0,0,0))
screen.blit(text_surface, (0,0))
pygame.draw.circle(screen, (255,255,255), pygame.mouse.get_pos(), 2)
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == 27:
raise SystemExit
if event.key == pygame.K_g:
grab_mouse = not grab_mouse
pygame.event.set_grab(grab_mouse)
if event.key == pygame.K_m:
mouse_visible = not mouse_visible
pygame.mouse.set_visible(mouse_visible)
if event.key == pygame.K_f:
full_screen = not full_screen
if full_screen:
screen = pygame.display.set_mode((640,480), pygame.FULLSCREEN)
else:
screen = pygame.display.set_mode((640,480))
pygame.display.update()