Download Now

    Reference TJoysticks

    Declared in Codebot.Hardware.pas on line 586

    TJoysticks is the collection of joysticks which are connected. Use the Joysticks function to get the one instance.
      TJoysticks = class
      public
        constructor Create;
        destructor Destroy; override;
        { Return True if a button of a joystick is down, or False if either does not
          exist }
        function ButtonDown(Index, Button: Integer): Boolean;
        { Return the value of an axis of a joystick, or 0 if either does not exist }
        function Axis(Index, AxisIndex: Integer): Single;
        { Return True if a named button of a gamepad is down, or False if the
          joystick does not exist or is not a gamepad }
        function GamepadDown(Index: Integer; Button: TGamepadButton): Boolean;
        { Return the value of a named axis of a gamepad, or 0 if the joystick does
          not exist or is not a gamepad }
        function GamepadAxis(Index: Integer; Named: TGamepadAxis): Single;
        { The number of joysticks }
        property Count: Integer read GetCount;
        { The joysticks by index }
        property Joystick[Index: Integer]: TJoystick read GetJoystick; default;
      end;

    See also