Skip to content

Commit 90964f6

Browse files
authored
Change some field types from Int32 to JoystickID (#285)
1 parent 0786172 commit 90964f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SDL/Event.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ data JoyButtonEventData =
396396
data JoyDeviceEventData =
397397
JoyDeviceEventData {joyDeviceEventConnection :: !JoyDeviceConnection
398398
-- ^ Was the device added or removed?
399-
,joyDeviceEventWhich :: !Int32
399+
,joyDeviceEventWhich :: !Raw.JoystickID
400400
-- ^ The instance id of the joystick that reported the event.
401401
}
402402
deriving (Eq,Ord,Generic,Show,Typeable)
@@ -427,7 +427,7 @@ data ControllerButtonEventData =
427427
data ControllerDeviceEventData =
428428
ControllerDeviceEventData {controllerDeviceEventConnection :: !ControllerDeviceConnection
429429
-- ^ Was the device added, removed, or remapped?
430-
,controllerDeviceEventWhich :: !Int32
430+
,controllerDeviceEventWhich :: !Raw.JoystickID
431431
-- ^ The joystick instance ID that reported the event.
432432
}
433433
deriving (Eq,Ord,Generic,Show,Typeable)

src/SDL/Input/Joystick.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ closeJoystick (Joystick j) = Raw.joystickClose j
108108
-- in future SDL events.
109109
--
110110
-- See @<https://wiki.libsdl.org/SDL_JoystickInstanceID SDL_JoystickInstanceID>@ for C documentation.
111-
getJoystickID :: MonadIO m => Joystick -> m (Int32)
111+
getJoystickID :: MonadIO m => Joystick -> m Raw.JoystickID
112112
getJoystickID (Joystick j) =
113113
throwIfNeg "SDL.Input.Joystick.getJoystickID" "SDL_JoystickInstanceID" $
114114
Raw.joystickInstanceID j

0 commit comments

Comments
 (0)