@@ -187,10 +187,11 @@ _pg_unicode_from_event(SDL_Event *event)
187
187
int capitalize = (capsheld && !shiftheld ) || (shiftheld && !capsheld );
188
188
189
189
#if SDL_VERSION_ATLEAST (3 , 0 , 0 )
190
- if (event -> key .mod & KMOD_CTRL ) {
190
+ if (event -> key .mod & KMOD_CTRL )
191
191
#else
192
- if (event -> key .keysym .mod & KMOD_CTRL ) {
192
+ if (event -> key .keysym .mod & KMOD_CTRL )
193
193
#endif
194
+ {
194
195
/* Control Key held, send control-key related unicode. */
195
196
if (key >= SDLK_a && key <= SDLK_z )
196
197
return key - SDLK_a + 1 ;
@@ -312,10 +313,11 @@ _pg_get_event_unicode(SDL_Event *event)
312
313
int i ;
313
314
for (i = 0 ; i < MAX_SCAN_UNICODE ; i ++ ) {
314
315
#if SDL_VERSION_ATLEAST (3 , 0 , 0 )
315
- if (scanunicode [i ].key == event -> key .scancode ) {
316
+ if (scanunicode [i ].key == event -> key .scancode )
316
317
#else
317
- if (scanunicode [i ].key == event -> key .keysym .scancode ) {
318
+ if (scanunicode [i ].key == event -> key .keysym .scancode )
318
319
#endif
320
+ {
319
321
if (event -> type == SDL_KEYUP ) {
320
322
/* mark the position as free real estate for other
321
323
* events to occupy. */
@@ -531,12 +533,13 @@ pg_event_filter(void *_, SDL_Event *event)
531
533
{
532
534
/* DON'T filter SDL_WINDOWEVENTs here. If we delete events, they
533
535
* won't be available to low-level SDL2 either.*/
536
+ switch (
534
537
#if SDL_VERSION_ATLEAST (3 , 0 , 0 )
535
- switch ( event -> type )
538
+ event -> type
536
539
#else
537
- switch ( event -> window .event )
540
+ event -> window .event
538
541
#endif
539
- {
542
+ ) {
540
543
case SDL_WINDOWEVENT_RESIZED :
541
544
SDL_FilterEvents (_pg_remove_pending_VIDEORESIZE , & newevent );
542
545
@@ -852,10 +855,11 @@ dict_or_obj_from_event(SDL_Event *event)
852
855
break ;
853
856
case SDL_ACTIVEEVENT :
854
857
#if SDL_VERSION_ATLEAST (3 , 0 , 0 )
855
- switch (event -> window .data2 ) {
858
+ switch (event -> window .data2 )
856
859
#else
857
- switch (event -> window .event ) {
860
+ switch (event -> window .event )
858
861
#endif
862
+ {
859
863
case SDL_WINDOWEVENT_ENTER :
860
864
gain = 1 ;
861
865
state = SDL_APPMOUSEFOCUS ;
@@ -1064,12 +1068,12 @@ dict_or_obj_from_event(SDL_Event *event)
1064
1068
PyFloat_FromDouble ((double )event -> wheel .preciseY ));
1065
1069
1066
1070
#else /* ~SDL_VERSION_ATLEAST(2, 0, 18) */
1067
- /* fallback to regular x and y when SDL version used does not
1068
- * support precise fields */
1069
- _pg_insobj (dict , "precise_x" ,
1070
- PyFloat_FromDouble ((double )event -> wheel .x ));
1071
- _pg_insobj (dict , "precise_y" ,
1072
- PyFloat_FromDouble ((double )event -> wheel .y ));
1071
+ /* fallback to regular x and y when SDL version used does not
1072
+ * support precise fields */
1073
+ _pg_insobj (dict , "precise_x" ,
1074
+ PyFloat_FromDouble ((double )event -> wheel .x ));
1075
+ _pg_insobj (dict , "precise_y" ,
1076
+ PyFloat_FromDouble ((double )event -> wheel .y ));
1073
1077
1074
1078
#endif /* ~SDL_VERSION_ATLEAST(2, 0, 18) */
1075
1079
_pg_insobj (
@@ -1295,12 +1299,12 @@ dict_or_obj_from_event(SDL_Event *event)
1295
1299
}
1296
1300
PyObject * pgWindow ;
1297
1301
#if SDL_VERSION_ATLEAST (3 , 0 , 0 )
1298
- if (!window ||
1299
- !(pgWindow = SDL_GetPointerProperty (SDL_GetWindowProperties (window ),
1300
- "pg_window" , NULL ))) {
1302
+ if (!window || !(pgWindow = SDL_GetPointerProperty (
1303
+ SDL_GetWindowProperties (window ), "pg_window" , NULL )))
1301
1304
#else
1302
- if (!window || !(pgWindow = SDL_GetWindowData (window , "pg_window" ))) {
1305
+ if (!window || !(pgWindow = SDL_GetWindowData (window , "pg_window" )))
1303
1306
#endif
1307
+ {
1304
1308
pgWindow = Py_None ;
1305
1309
}
1306
1310
Py_INCREF (pgWindow );
0 commit comments