Skip to content

TSdlHapticID

This is a unique ID for a haptic device for the time it is connected to the system, and is never reused for the lifetime of the application.

If the haptic device is disconnected and reconnected, it will get a new ID.

The value 0 is an invalid ID.

Definition

Unit: Neslib.Sdl3.Haptic

type TSdlHapticID = record ... end;

Properties

Name Description
Devices A list of currently connected haptic devices.
Name Get the implementation dependent name of the haptic device, or an empty string if no name can be found.

Operators

Name Description
Equal(TSdlHapticID, TSdlHapticID) Used to compare against another TSdlHapticID.
Equal(TSdlHapticID, Cardinal) Used to compare against 0.
Implicit Used to set the value to 0.
NotEqual(TSdlHapticID, TSdlHapticID) Used to compare against another TSdlHapticID.
NotEqual(TSdlHapticID, Cardinal) Used to compare against 0.

Methods

Name Description
Open Open a haptic device for use.

Property Descriptions

Devices

A list of currently connected haptic devices.

class property Devices: TArray<TSdlHapticID> read GetDevices

Type: TArray<TSdlHapticID>

Exceptions

ESdlError: Raised on failure.

See Also


Name

Get the implementation dependent name of the haptic device, or an empty string if no name can be found.

This can be used before any haptic devices are opened.

property Name: String read GetName

Type: String

See Also


Operator Descriptions

Equal(TSdlHapticID, TSdlHapticID)

Used to compare against another TSdlHapticID.

class operator Equal(const ALeft, ARight: TSdlHapticID): Boolean; inline; static

Parameters

ALeft: TSdlHapticID

ARight: TSdlHapticID

Returns

Boolean


Equal(TSdlHapticID, Cardinal)

Used to compare against 0.

class operator Equal(const ALeft: TSdlHapticID; const ARight: Cardinal): Boolean; inline; static

Parameters

ALeft: TSdlHapticID

ARight: Cardinal

Returns

Boolean


Implicit(Cardinal)

Used to set the value to 0.

class operator Implicit(const AValue: Cardinal): TSdlHapticID; inline; static

Parameters

AValue: Cardinal

Returns

TSdlHapticID


NotEqual(TSdlHapticID, TSdlHapticID)

Used to compare against another TSdlHapticID.

class operator NotEqual(const ALeft, ARight: TSdlHapticID): Boolean; inline; static

Parameters

ALeft: TSdlHapticID

ARight: TSdlHapticID

Returns

Boolean


NotEqual(TSdlHapticID, Cardinal)

Used to compare against 0.

class operator NotEqual(const ALeft: TSdlHapticID; const ARight: Cardinal): Boolean; inline; static

Parameters

ALeft: TSdlHapticID

ARight: Cardinal

Returns

Boolean


Method Descriptions

Open

Open a haptic device for use.

When opening a haptic device, its gain will be set to maximum and autocenter will be disabled. To modify these values use TSdlHaptic.SetGain and TSdlHaptic.SetAutoCenter.

function Open: TSdlHaptic; inline

Exceptions

ESdlError: Raised on failure.

Returns

TSdlHaptic: The haptic device.

See Also