Mercurial > sdl-ios-xcode
comparison src/video/dga/SDL_dgaevents.c @ 1194:b8f167923bfc
Date: Sun, 04 Dec 2005 21:43:46 -0500
From: Jonathan Atkins <jcatki@jcatki.no-ip.org>
Subject: SDL patch: DGA key events
I kept seeing DGA die on me whenever I press a key.
I tracked it down and it seems that the new indirect X via pointers
system messed it up. It needed to have the pX* pointers well defined to
call, in particular, pXNextEvent. Also, the X11_TranslateKey function
prototype was changed, but not updated in the dga driver. perhaps other
files are also affected.
Not sure what releases may suffer from this too.
thanks!
-Jon Atkins
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 05 Dec 2005 04:36:53 +0000 |
parents | 045f186426e1 |
children | 0c105755b110 |
comparison
equal
deleted
inserted
replaced
1193:3bafdbba8dcf | 1194:b8f167923bfc |
---|---|
34 #include "SDL_sysvideo.h" | 34 #include "SDL_sysvideo.h" |
35 #include "SDL_events_c.h" | 35 #include "SDL_events_c.h" |
36 #include "SDL_dgavideo.h" | 36 #include "SDL_dgavideo.h" |
37 #include "SDL_dgaevents_c.h" | 37 #include "SDL_dgaevents_c.h" |
38 | 38 |
39 /* get function pointers... */ | |
40 #include "../x11/SDL_x11dyn.h" | |
41 | |
39 /* Heheh we're using X11 event code */ | 42 /* Heheh we're using X11 event code */ |
40 extern int X11_Pending(Display *display); | 43 extern int X11_Pending(Display *display); |
41 extern void X11_InitKeymap(void); | 44 extern void X11_InitKeymap(void); |
42 extern SDL_keysym *X11_TranslateKey(Display *display, XKeyEvent *xkey, | 45 extern SDL_keysym *X11_TranslateKey(Display *display, XIC ic, XKeyEvent *xkey, |
43 KeyCode kc, SDL_keysym *keysym); | 46 KeyCode kc, SDL_keysym *keysym); |
44 | 47 |
45 static int DGA_DispatchEvent(_THIS) | 48 static int DGA_DispatchEvent(_THIS) |
46 { | 49 { |
47 int posted; | 50 int posted; |
82 SDL_keysym keysym; | 85 SDL_keysym keysym; |
83 XKeyEvent xkey; | 86 XKeyEvent xkey; |
84 | 87 |
85 SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey); | 88 SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey); |
86 posted = SDL_PrivateKeyboard((xevent.type == KeyPress), | 89 posted = SDL_PrivateKeyboard((xevent.type == KeyPress), |
87 X11_TranslateKey(DGA_Display, | 90 X11_TranslateKey(DGA_Display, NULL/*no XIC*/, |
88 &xkey, xkey.keycode, | 91 &xkey, xkey.keycode, |
89 &keysym)); | 92 &keysym)); |
90 } | 93 } |
91 break; | 94 break; |
92 | 95 |