[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] [PATCH] JOYHATMOTION events with wrong 'value' attrib
- To: pygame-users@seul.org
- Subject: [pygame] [PATCH] JOYHATMOTION events with wrong 'value' attrib
- From: Latimerius <pvl@uh.cz>
- Date: Sun, 10 Aug 2003 14:06:34 +0200
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sun, 10 Aug 2003 08:06:46 -0400
- Reply-to: pygame-users@seul.org
- Sender: owner-pygame-users@seul.org
- User-agent: Mutt/1.3.28i
Hello,
there seems to be a typo in the code that assembles JOYHATMOTION event
objects - the 'value' attribute is computed incorrectly. The following
trivial patch should correct it:
--- event-orig.c 2003-08-10 13:56:33.000000000 +0000
+++ event.c 2003-08-10 13:57:36.000000000 +0000
@@ -271,7 +271,7 @@
hx = hy = 0;
if(event->jhat.value&SDL_HAT_UP) hy = 1;
else if(event->jhat.value&SDL_HAT_DOWN) hy = -1;
- if(event->jhat.value&SDL_HAT_LEFT) hx = 1;
+ if(event->jhat.value&SDL_HAT_RIGHT) hx = 1;
else if(event->jhat.value&SDL_HAT_LEFT) hx = -1;
insobj(dict, "value", Py_BuildValue("(ii)", hx, hy));
break;
Thanks for the great pygame library!
latimerius