Mercurial > sdl-ios-xcode
comparison src/video/gem/SDL_gemevents.c @ 1089:b3f7c4af00e0
Don't use both mouse events for the same task
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Thu, 07 Jul 2005 13:38:22 +0000 |
parents | 6091b9ca1a97 |
children | 37fc855580af |
comparison
equal
deleted
inserted
replaced
1088:6091b9ca1a97 | 1089:b3f7c4af00e0 |
---|---|
140 { | 140 { |
141 int quit, resultat, event_mask; | 141 int quit, resultat, event_mask; |
142 short buffer[8], kc; | 142 short buffer[8], kc; |
143 short x2,y2,w2,h2; | 143 short x2,y2,w2,h2; |
144 | 144 |
145 quit = 0; | 145 quit = |
146 mouse_event = | |
147 x2=y2=w2=h2 = 0; | |
146 | 148 |
147 event_mask = MU_MESAG|MU_TIMER|MU_KEYBD; | 149 event_mask = MU_MESAG|MU_TIMER|MU_KEYBD; |
148 if (!GEM_fullscreen && (GEM_handle>=0)) { | 150 if (!GEM_fullscreen && (GEM_handle>=0)) { |
149 wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2); | 151 wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2); |
150 event_mask |= MU_M1|MU_M2; | 152 event_mask |= MU_M1; |
151 } else { | 153 if ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { |
152 x2=y2=w2=h2=0; | 154 mouse_event = MO_LEAVE; |
155 } else { | |
156 mouse_event = MO_ENTER; | |
157 } | |
153 } | 158 } |
154 | 159 |
155 resultat = evnt_multi( | 160 resultat = evnt_multi( |
156 event_mask, | 161 event_mask, |
157 0,0,0, | 162 0,0,0, |
158 MO_ENTER,x2,y2,w2,h2, | 163 mouse_event,x2,y2,w2,h2, |
159 MO_LEAVE,x2,y2,w2,h2, | 164 0,0,0,0,0, |
160 buffer, | 165 buffer, |
161 10, | 166 10, |
162 &dummy,&dummy,&dummy,&kstate,&kc,&dummy | 167 &dummy,&dummy,&dummy,&kstate,&kc,&dummy |
163 ); | 168 ); |
164 | 169 |
177 } | 182 } |
178 | 183 |
179 /* Mouse entering/leaving window */ | 184 /* Mouse entering/leaving window */ |
180 if (resultat & MU_M1) { | 185 if (resultat & MU_M1) { |
181 if (this->input_grab == SDL_GRAB_OFF) { | 186 if (this->input_grab == SDL_GRAB_OFF) { |
182 if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { | 187 if (SDL_GetAppState() & SDL_APPMOUSEFOCUS) { |
188 SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS); | |
189 } else { | |
183 SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); | 190 SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); |
184 } | 191 } |
185 } | |
186 } | |
187 if (resultat & MU_M2) { | |
188 if (this->input_grab == SDL_GRAB_OFF) { | |
189 if ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { | |
190 SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS); | |
191 ] | |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 /* Timer event ? */ | 195 /* Timer event ? */ |
196 if ((resultat & MU_TIMER) || quit) | 196 if ((resultat & MU_TIMER) || quit) |