Skip to content

Commit

Permalink
Change some field types from Int32 to JoystickID
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-martin committed Mar 22, 2023
1 parent 21519b5 commit 060ae92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/SDL/Event.hs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ data JoyButtonEventData =
data JoyDeviceEventData =
JoyDeviceEventData {joyDeviceEventConnection :: !JoyDeviceConnection
-- ^ Was the device added or removed?
,joyDeviceEventWhich :: !Int32
,joyDeviceEventWhich :: !Raw.JoystickID
-- ^ The instance id of the joystick that reported the event.
}
deriving (Eq,Ord,Generic,Show,Typeable)
Expand Down Expand Up @@ -427,7 +427,7 @@ data ControllerButtonEventData =
data ControllerDeviceEventData =
ControllerDeviceEventData {controllerDeviceEventConnection :: !ControllerDeviceConnection
-- ^ Was the device added, removed, or remapped?
,controllerDeviceEventWhich :: !Int32
,controllerDeviceEventWhich :: !Raw.JoystickID
-- ^ The joystick instance ID that reported the event.
}
deriving (Eq,Ord,Generic,Show,Typeable)
Expand Down
2 changes: 1 addition & 1 deletion src/SDL/Input/Joystick.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ closeJoystick (Joystick j) = Raw.joystickClose j
-- in future SDL events.
--
-- See @<https://wiki.libsdl.org/SDL_JoystickInstanceID SDL_JoystickInstanceID>@ for C documentation.
getJoystickID :: MonadIO m => Joystick -> m (Int32)
getJoystickID :: MonadIO m => Joystick -> m Raw.JoystickID
getJoystickID (Joystick j) =
throwIfNeg "SDL.Input.Joystick.getJoystickID" "SDL_JoystickInstanceID" $
Raw.joystickInstanceID j
Expand Down

0 comments on commit 060ae92

Please sign in to comment.