helm-0.4: A functionally reactive game engine.

Safe HaskellNone

FRP.Helm.Joystick

Contents

Description

Contains signals that sample input from joysticks.

Synopsis

Types

type Joystick = JoystickSource

A type describing a joystick.

Probing

available :: SignalGen (Signal Int)Source

The amount of joysticks available.

name :: Int -> SignalGen (Signal String)Source

The name of a joystick. Can throw an exception when sampled if the joystick index is invalid.

open :: Int -> SignalGen (Signal Joystick)Source

The joystick at a certain slot. Can throw an exception when sampled if the joystick index is invalid.

index :: Joystick -> SignalGen (Signal Int)Source

The index of a joystick.

availableAxes :: Joystick -> SignalGen (Signal Int)Source

The amount of axes available for a joystick.

availableBalls :: Joystick -> SignalGen (Signal Int)Source

The amount of balls available for a joystick.

availableHats :: Joystick -> SignalGen (Signal Int)Source

The amount of hats available for a joystick.

availableButtons :: Joystick -> SignalGen (Signal Int)Source

The amount of buttons available for a joystick.

Joystick State

axis :: Joystick -> Int -> SignalGen (Signal Int)Source

The current state of the axis of the joystick.

hat :: Joystick -> Int -> SignalGen (Signal (Int, Int))Source

The current state of the hat of the joystick, returned as a directional tuple. For example, up is (0, -1), left (-1, 0), bottom-right is (1, 1), etc.

button :: Joystick -> Int -> SignalGen (Signal Bool)Source

The current state of the button of the joystick.

ball :: Joystick -> Int -> SignalGen (Signal (Int, Int))Source

The current state of the ball of the joystick.