@@ -986,7 +986,7 @@ impl Event {
986
986
let event = sys:: SDL_JoyAxisEvent {
987
987
type_ : SDL_EventType :: SDL_JOYAXISMOTION as u32 ,
988
988
timestamp,
989
- which,
989
+ which : which as i32 ,
990
990
axis : axis_idx,
991
991
value,
992
992
padding1 : 0 ,
@@ -1010,7 +1010,7 @@ impl Event {
1010
1010
let event = sys:: SDL_JoyBallEvent {
1011
1011
type_ : SDL_EventType :: SDL_JOYBALLMOTION as u32 ,
1012
1012
timestamp,
1013
- which,
1013
+ which : which as i32 ,
1014
1014
ball : ball_idx,
1015
1015
xrel,
1016
1016
yrel,
@@ -1034,7 +1034,7 @@ impl Event {
1034
1034
let event = sys:: SDL_JoyHatEvent {
1035
1035
type_ : SDL_EventType :: SDL_JOYHATMOTION as u32 ,
1036
1036
timestamp,
1037
- which,
1037
+ which : which as i32 ,
1038
1038
hat : hat_idx,
1039
1039
value : hatvalue,
1040
1040
padding1 : 0 ,
@@ -1054,7 +1054,7 @@ impl Event {
1054
1054
let event = sys:: SDL_JoyButtonEvent {
1055
1055
type_ : SDL_EventType :: SDL_JOYBUTTONDOWN as u32 ,
1056
1056
timestamp,
1057
- which,
1057
+ which : which as i32 ,
1058
1058
button : button_idx,
1059
1059
state : sys:: SDL_PRESSED as u8 ,
1060
1060
padding1 : 0 ,
@@ -1075,7 +1075,7 @@ impl Event {
1075
1075
let event = sys:: SDL_JoyButtonEvent {
1076
1076
type_ : SDL_EventType :: SDL_JOYBUTTONUP as u32 ,
1077
1077
timestamp,
1078
- which,
1078
+ which : which as i32 ,
1079
1079
button : button_idx,
1080
1080
state : sys:: SDL_RELEASED as u8 ,
1081
1081
padding1 : 0 ,
@@ -1110,7 +1110,7 @@ impl Event {
1110
1110
let event = sys:: SDL_JoyDeviceEvent {
1111
1111
type_ : SDL_EventType :: SDL_JOYDEVICEREMOVED as u32 ,
1112
1112
timestamp,
1113
- which,
1113
+ which : which as i32 ,
1114
1114
} ;
1115
1115
unsafe {
1116
1116
ptr:: copy ( & event, ret. as_mut_ptr ( ) as * mut sys:: SDL_JoyDeviceEvent , 1 ) ;
@@ -1128,7 +1128,7 @@ impl Event {
1128
1128
let event = sys:: SDL_ControllerAxisEvent {
1129
1129
type_ : SDL_EventType :: SDL_CONTROLLERAXISMOTION as u32 ,
1130
1130
timestamp,
1131
- which,
1131
+ which : which as i32 ,
1132
1132
axis : axisval as u8 ,
1133
1133
value,
1134
1134
padding1 : 0 ,
@@ -1150,7 +1150,7 @@ impl Event {
1150
1150
let event = sys:: SDL_ControllerButtonEvent {
1151
1151
type_ : SDL_EventType :: SDL_CONTROLLERBUTTONDOWN as u32 ,
1152
1152
timestamp,
1153
- which,
1153
+ which : which as i32 ,
1154
1154
// This conversion turns an i32 into a u8; signed-to-unsigned conversions
1155
1155
// are a bit of a code smell, but that appears to be how SDL defines it.
1156
1156
button : buttonval as u8 ,
@@ -1173,7 +1173,7 @@ impl Event {
1173
1173
let event = sys:: SDL_ControllerButtonEvent {
1174
1174
type_ : SDL_EventType :: SDL_CONTROLLERBUTTONUP as u32 ,
1175
1175
timestamp,
1176
- which,
1176
+ which : which as i32 ,
1177
1177
button : buttonval as u8 ,
1178
1178
state : sys:: SDL_RELEASED as u8 ,
1179
1179
padding1 : 0 ,
@@ -1208,7 +1208,7 @@ impl Event {
1208
1208
let event = sys:: SDL_ControllerDeviceEvent {
1209
1209
type_ : SDL_EventType :: SDL_CONTROLLERDEVICEREMOVED as u32 ,
1210
1210
timestamp,
1211
- which,
1211
+ which : which as i32 ,
1212
1212
} ;
1213
1213
unsafe {
1214
1214
ptr:: copy ( & event, ret. as_mut_ptr ( ) as * mut sys:: SDL_ControllerDeviceEvent , 1 ) ;
@@ -1224,7 +1224,7 @@ impl Event {
1224
1224
let event = sys:: SDL_ControllerDeviceEvent {
1225
1225
type_ : SDL_EventType :: SDL_CONTROLLERDEVICEREMAPPED as u32 ,
1226
1226
timestamp,
1227
- which,
1227
+ which : which as i32 ,
1228
1228
} ;
1229
1229
unsafe {
1230
1230
ptr:: copy ( & event, ret. as_mut_ptr ( ) as * mut sys:: SDL_ControllerDeviceEvent , 1 ) ;
@@ -1361,7 +1361,7 @@ impl Event {
1361
1361
Event :: MouseMotion {
1362
1362
timestamp : event. timestamp ,
1363
1363
window_id : event. windowID ,
1364
- which : event. which ,
1364
+ which : event. which as u32 ,
1365
1365
mousestate : mouse:: MouseState :: from_sdl_state ( event. state ) ,
1366
1366
x : event. x ,
1367
1367
y : event. y ,
@@ -1375,7 +1375,7 @@ impl Event {
1375
1375
Event :: MouseButtonDown {
1376
1376
timestamp : event. timestamp ,
1377
1377
window_id : event. windowID ,
1378
- which : event. which ,
1378
+ which : event. which as u32 ,
1379
1379
mouse_btn : mouse:: MouseButton :: from_ll ( event. button ) ,
1380
1380
clicks : event. clicks ,
1381
1381
x : event. x ,
@@ -1388,7 +1388,7 @@ impl Event {
1388
1388
Event :: MouseButtonUp {
1389
1389
timestamp : event. timestamp ,
1390
1390
window_id : event. windowID ,
1391
- which : event. which ,
1391
+ which : event. which as u32 ,
1392
1392
mouse_btn : mouse:: MouseButton :: from_ll ( event. button ) ,
1393
1393
clicks : event. clicks ,
1394
1394
x : event. x ,
@@ -1401,7 +1401,7 @@ impl Event {
1401
1401
Event :: MouseWheel {
1402
1402
timestamp : event. timestamp ,
1403
1403
window_id : event. windowID ,
1404
- which : event. which ,
1404
+ which : event. which as u32 ,
1405
1405
x : event. x ,
1406
1406
y : event. y ,
1407
1407
direction : mouse:: MouseWheelDirection :: from_ll ( event. direction ) ,
@@ -1412,7 +1412,7 @@ impl Event {
1412
1412
let event = raw. jaxis ;
1413
1413
Event :: JoyAxisMotion {
1414
1414
timestamp : event. timestamp ,
1415
- which : event. which ,
1415
+ which : event. which as u32 ,
1416
1416
axis_idx : event. axis ,
1417
1417
value : event. value
1418
1418
}
@@ -1421,7 +1421,7 @@ impl Event {
1421
1421
let event = raw. jball ;
1422
1422
Event :: JoyBallMotion {
1423
1423
timestamp : event. timestamp ,
1424
- which : event. which ,
1424
+ which : event. which as u32 ,
1425
1425
ball_idx : event. ball ,
1426
1426
xrel : event. xrel ,
1427
1427
yrel : event. yrel
@@ -1431,7 +1431,7 @@ impl Event {
1431
1431
let event = raw. jhat ;
1432
1432
Event :: JoyHatMotion {
1433
1433
timestamp : event. timestamp ,
1434
- which : event. which ,
1434
+ which : event. which as u32 ,
1435
1435
hat_idx : event. hat ,
1436
1436
state : joystick:: HatState :: from_raw ( event. value ) ,
1437
1437
}
@@ -1440,30 +1440,30 @@ impl Event {
1440
1440
let event = raw. jbutton ;
1441
1441
Event :: JoyButtonDown {
1442
1442
timestamp : event. timestamp ,
1443
- which : event. which ,
1443
+ which : event. which as u32 ,
1444
1444
button_idx : event. button
1445
1445
}
1446
1446
}
1447
1447
EventType :: JoyButtonUp => {
1448
1448
let event = raw. jbutton ;
1449
1449
Event :: JoyButtonUp {
1450
1450
timestamp : event. timestamp ,
1451
- which : event. which ,
1451
+ which : event. which as u32 ,
1452
1452
button_idx : event. button
1453
1453
}
1454
1454
}
1455
1455
EventType :: JoyDeviceAdded => {
1456
1456
let event = raw. jdevice ;
1457
1457
Event :: JoyDeviceAdded {
1458
1458
timestamp : event. timestamp ,
1459
- which : event. which as i32
1459
+ which : event. which as u32 ,
1460
1460
}
1461
1461
}
1462
1462
EventType :: JoyDeviceRemoved => {
1463
1463
let event = raw. jdevice ;
1464
1464
Event :: JoyDeviceRemoved {
1465
1465
timestamp : event. timestamp ,
1466
- which : event. which
1466
+ which : event. which as u32 ,
1467
1467
}
1468
1468
}
1469
1469
@@ -1473,7 +1473,7 @@ impl Event {
1473
1473
1474
1474
Event :: ControllerAxisMotion {
1475
1475
timestamp : event. timestamp ,
1476
- which : event. which ,
1476
+ which : event. which as u32 ,
1477
1477
axis,
1478
1478
value : event. value
1479
1479
}
@@ -1484,7 +1484,7 @@ impl Event {
1484
1484
1485
1485
Event :: ControllerButtonDown {
1486
1486
timestamp : event. timestamp ,
1487
- which : event. which ,
1487
+ which : event. which as u32 ,
1488
1488
button
1489
1489
}
1490
1490
}
@@ -1494,29 +1494,29 @@ impl Event {
1494
1494
1495
1495
Event :: ControllerButtonUp {
1496
1496
timestamp : event. timestamp ,
1497
- which : event. which ,
1497
+ which : event. which as u32 ,
1498
1498
button
1499
1499
}
1500
1500
}
1501
1501
EventType :: ControllerDeviceAdded => {
1502
1502
let event = raw. cdevice ;
1503
1503
Event :: ControllerDeviceAdded {
1504
1504
timestamp : event. timestamp ,
1505
- which : event. which as i32
1505
+ which : event. which as u32 ,
1506
1506
}
1507
1507
}
1508
1508
EventType :: ControllerDeviceRemoved => {
1509
1509
let event = raw. cdevice ;
1510
1510
Event :: ControllerDeviceRemoved {
1511
1511
timestamp : event. timestamp ,
1512
- which : event. which
1512
+ which : event. which as u32 ,
1513
1513
}
1514
1514
}
1515
1515
EventType :: ControllerDeviceRemapped => {
1516
1516
let event = raw. cdevice ;
1517
1517
Event :: ControllerDeviceRemapped {
1518
1518
timestamp : event. timestamp ,
1519
- which : event. which
1519
+ which : event. which as u32 ,
1520
1520
}
1521
1521
}
1522
1522
0 commit comments