Interface IGamolfJoystickService
Unit
Gamolf.RTL.Joystick
Declaration
type IGamolfJoystickService = interface(IInterface)
Description
Platform service to access to joystick/gamepad controllers on a computer
Attributes
- GUID['{74BA65B4-B468-41E2-A5FF-1FB92A79E9F4}']
Hierarchy
- IInterface
- IGamolfJoystickService
Overview
Methods
Description
Methods
 |
procedure StartDiscovery; |
|
Scan for available devices (if some are already used, their ID could change)
|
 |
function Count: byte; |
|
Return the number of joysticks managed by the system
|
 |
function isConnected(JoystickID: TJoystickID): boolean; |
|
Return "true" if the JoystickID controller is connected and available
|
 |
procedure getInfo(JoystickID: TJoystickID; var Joystick: TJoystickInfo); |
|
Return a TJoystick for the JoystickID controller
|
 |
function isPressed(JoystickID: TJoystickID; ButtonID: TButtonID): boolean; |
|
Check if button "ButtonID" from controller "JoystickID" is pressed or not
|
 |
procedure getXY(JoystickID: TJoystickID; var X, Y: single); |
|
Return X,Y axes values for JoystickID controller
|
 |
function getX(JoystickID: TJoystickID): single; |
|
Return X axes values for JoystickID controller
|
 |
function getY(JoystickID: TJoystickID): single; |
|
Return Y axes values for JoystickID controller
|
 |
function getZ(JoystickID: TJoystickID): single; |
|
Return Z axes values for JoystickID controller
|
 |
function getDPad(JoystickID: TJoystickID; FromXYWhenNoDPadAvailable: boolean = false): word; |
|
Return the DPad value between (0-359° or 65535) Compare it to Top, TopRight/RightTop, Right, BottomRight/RightBottom, Bottom, BottomLeft/LeftBottom, Left, LeftTop/TopLeft, Center values from TJoystickDPad enumeration
|
 |
function hasDPad(JoystickID: TJoystickID): boolean; |
|
Check if the game controller has a DPad/POV button
|
 |
function isDPad(JoystickID: TJoystickID; JoystickDPad: TJoystickDPad) : boolean; overload; |
|
Check is the DPad / POV is in a standard position for a JoystickID or in general
|
 |
function isDPad(DPad: word; JoystickDPad: TJoystickDPad): boolean; overload; |
|
|
 |
function isDPad(DPad: word; JoystickDPads: array of TJoystickDPad) : boolean; overload; |
|
|
 |
function getDPadFromXY(X, Y: single): word; |
|
Get orientation (like DPad) from (x,y) axis
|
 |
procedure getXYFromDPad(DPad: word; var X, Y: single); |
|
Get the values for (x,y) axis from a DPad/POV orientation
|
 |
function hasJoystickButtonsAPI: boolean; |
|
Returns true for platforms where buttons place are known and mapped correctly to TJoystickButtons enumeration. If false, you can use buttons ID to check if they are pressed or not.
|
Delphi Game Engine (c) 2021-2025
Patrick PREMARTIN - Powered by
PasDoc
Generated by PasDoc 0.16.0.