Unit CastleJoysticks

Description

Receiving input from joysticks and gamepads.

Overview

Classes, Interfaces, Objects and Records

Name Description
Record TJoyInfo  
Record TJoyState  
Record TJoy  
Class TJoysticks TJoysticks is a class for joysticks and gamepads management

Functions and Procedures

procedure EnableJoysticks;

Types

PJoyInfo = ˆTJoyInfo;
PJoyState = ˆTJoyState;
PJoy = ˆTJoy;
TOnJoyAxisMove = procedure(const Joy: PJoy; const Axis: Byte; const Value: Single) of object;
TOnJoyButtonEvent = procedure(const Joy: PJoy; const Button: Byte) of object;

Constants

JOY_HAS_Z = $000001;
JOY_HAS_R = $000002;
JOY_HAS_U = $000004;
JOY_HAS_V = $000008;
JOY_HAS_POV = $000010;
JOY_AXIS_X = 0;
JOY_AXIS_Y = 1;
JOY_AXIS_Z = 2;
JOY_AXIS_R = 3;
JOY_AXIS_U = 4;
JOY_AXIS_V = 5;
JOY_POVX = 6;
JOY_POVY = 7;

Variables

Joysticks: TJoysticks;

Description

Functions and Procedures

procedure EnableJoysticks;

Initialize Joysticks global variable.

Types

PJoyInfo = ˆTJoyInfo;

If defined, the compiled code will have embedded all the variations of basic fonts for the X3D Text node (see [https://castle-engine.io/x3d_implementation_text.php]). This is comfortable (the FontStyle font works, with 3 * 4 font variations, out of the box), but it increases your exe size — possibly without a reason, if you don't use FontStyle X3D node.

Undefine this to conserve around 0.7 MB in exe size. All the Text X3D nodes will use standard sans non-bold, non-italic font.

PJoyState = ˆTJoyState;
 
PJoy = ˆTJoy;
 
TOnJoyAxisMove = procedure(const Joy: PJoy; const Axis: Byte; const Value: Single) of object;

Joystick axis move event.

TOnJoyButtonEvent = procedure(const Joy: PJoy; const Button: Byte) of object;

Joystick button action event. Used on button press/up/down.

Constants

JOY_HAS_Z = $000001;
 
JOY_HAS_R = $000002;
 
JOY_HAS_U = $000004;
 
JOY_HAS_V = $000008;
 
JOY_HAS_POV = $000010;
 
JOY_AXIS_X = 0;
 
JOY_AXIS_Y = 1;
 
JOY_AXIS_Z = 2;
 
JOY_AXIS_R = 3;
 
JOY_AXIS_U = 4;
 
JOY_AXIS_V = 5;
 
JOY_POVX = 6;
 
JOY_POVY = 7;
 

Variables

Joysticks: TJoysticks;

Global joystick manager object (singelton). To initialize Joysticks instance run EnableJoysticks procedure


Generated by PasDoc 0.15.0.