Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Graphics.UI.GlfwG.Joystick
Synopsis
- data Joystick
- data JoystickState
- data JoystickButtonState
- joystickPresent :: Joystick -> IO Bool
- joystickIsGamepad :: Joystick -> IO Bool
- getJoystickAxes :: Joystick -> IO (Maybe [Double])
- getJoystickButtons :: Joystick -> IO (Maybe [JoystickButtonState])
- getJoystickHats :: Joystick -> IO (Maybe [JoystickHatState])
- data JoystickHatState
- getJoystickName :: Joystick -> IO (Maybe String)
- getJoystickGUID :: Joystick -> IO (Maybe String)
- setJoystickCallback :: Maybe JoystickCallback -> IO ()
- type JoystickCallback = Joystick -> JoystickState -> IO ()
Documentation
For use with the Joystick Input system.
Constructors
Joystick'1 | |
Joystick'2 | |
Joystick'3 | |
Joystick'4 | |
Joystick'5 | |
Joystick'6 | |
Joystick'7 | |
Joystick'8 | |
Joystick'9 | |
Joystick'10 | |
Joystick'11 | |
Joystick'12 | |
Joystick'13 | |
Joystick'14 | |
Joystick'15 | |
Joystick'16 |
Instances
Data Joystick | |
Defined in Graphics.UI.GLFW.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Joystick -> c Joystick # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Joystick # toConstr :: Joystick -> Constr # dataTypeOf :: Joystick -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Joystick) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Joystick) # gmapT :: (forall b. Data b => b -> b) -> Joystick -> Joystick # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Joystick -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Joystick -> r # gmapQ :: (forall d. Data d => d -> u) -> Joystick -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Joystick -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Joystick -> m Joystick # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Joystick -> m Joystick # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Joystick -> m Joystick # | |
Bounded Joystick | |
Enum Joystick | |
Defined in Graphics.UI.GLFW.Types | |
Generic Joystick | |
Read Joystick | |
Show Joystick | |
NFData Joystick | |
Defined in Graphics.UI.GLFW.Types | |
Eq Joystick | |
Ord Joystick | |
Defined in Graphics.UI.GLFW.Types | |
type Rep Joystick | |
Defined in Graphics.UI.GLFW.Types type Rep Joystick = D1 ('MetaData "Joystick" "Graphics.UI.GLFW.Types" "GLFW-b-3.3.9.1-CbbIOqvtyyzkbPgJI2V5g" 'False) ((((C1 ('MetaCons "Joystick'1" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'2" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Joystick'3" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'4" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Joystick'5" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'6" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Joystick'7" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'8" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Joystick'9" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'10" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Joystick'11" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'12" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Joystick'13" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'14" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Joystick'15" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Joystick'16" 'PrefixI 'False) (U1 :: Type -> Type))))) |
data JoystickState #
Part of the JoystickCallback
, for when a monitor gets
connected or disconnected.
Constructors
JoystickState'Connected | |
JoystickState'Disconnected |
Instances
data JoystickButtonState #
If a given joystick button is pressed or not when
getJoystickButtons
is called.
Instances
joystickPresent :: Joystick -> IO Bool #
Tests if the joystick is present at all See glfwJoystickPresent
joystickIsGamepad :: Joystick -> IO Bool #
This function returns whether the specified joystick is both present and has a gamepad mapping. See glfwJoystickIsGamepad
getJoystickAxes :: Joystick -> IO (Maybe [Double]) #
Returns the values of all axes of the specified joystick, normalized to between -1.0 and 1.0 See glfwGetJoystickAxes
getJoystickButtons :: Joystick -> IO (Maybe [JoystickButtonState]) #
Returns a list of all joystick button states for the specified joystick. See glfwGetJoystickButtons
getJoystickHats :: Joystick -> IO (Maybe [JoystickHatState]) #
Returns a list of all hats of the specified joystick. See glfwGetJoystickHats
data JoystickHatState #
The valid hat states of a joystick. Part of the joystick hat system.
Constructors
Instances
getJoystickName :: Joystick -> IO (Maybe String) #
A human-readable name for a Joystick. Not guranteed to be unique. See glfwGetJoystickName
getJoystickGUID :: Joystick -> IO (Maybe String) #
This function returns the SDL compatible GUID of the specified joystick. See glfwGetJoystickGUID
setJoystickCallback :: Maybe JoystickCallback -> IO () #
Sets a callback for when a joystick is connected or disconnected. See glfwSetJoystickCallback
type JoystickCallback = Joystick -> JoystickState -> IO () #
Fires when a joystick is connected or disconnected.