Skip to content

TSdlSensor

An opened SDL sensor.

Definition

Unit: Neslib.Sdl3.Input

type TSdlSensor = record ... end;

Properties

Name Description
ID The instance ID of the sensor.
Kind The type of the sensor.
Name The implementation dependent name of the sensor.
NonPortableType The platform dependent type of the sensor.
Properties The properties associated with the sensor.
Sensors A list of currently connected sensors.

Operators

Name Description
Equal(TSdlSensor, TSdlSensor) Used to compare against another TSdlSensor.
Equal(TSdlSensor, Pointer) Used to compare against nil.
Implicit Used to set the value to nil.
NotEqual(TSdlSensor, TSdlSensor) Used to compare against another TSdlSensor.
NotEqual(TSdlSensor, Pointer) Used to compare against nil.

Methods

Name Description
Close Close the sensor previously opened with Open.
FromID Return the snsor associated with an opened instance ID.
GetSensorData Get the current state of the opened sensor.
Open Open a sensor for use.
Update Update the current state of the open sensors.

Property Descriptions

ID

The instance ID of the sensor.

property ID: TSdlSensorID read GetID

Type: TSdlSensorID

Exceptions

ESdlError: Raised on failure.


Kind

The type of the sensor.

property Kind: TSdlSensorKind read GetKind

Type: TSdlSensorKind

Exceptions

ESdlError: Raised on failure.


Name

The implementation dependent name of the sensor.

property Name: String read GetName

Type: String

Exceptions

ESdlError: Raised on failure.


NonPortableType

The platform dependent type of the sensor.

property NonPortableType: Integer read GetNonPortableType

Type: Integer

Exceptions

ESdlError: Raised on failure.


Properties

The properties associated with the sensor.

property Properties: TSdlProperties read GetProperties

Type: TSdlProperties

Exceptions

ESdlError: Raised on failure.


Sensors

A list of currently connected sensors.

class property Sensors: TArray<TSdlSensorID> read GetSensors

Type: TArray<TSdlSensorID>

Exceptions

ESdlError: Raised on failure.


Operator Descriptions

Equal(TSdlSensor, TSdlSensor)

Used to compare against another TSdlSensor.

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

Parameters

ALeft: TSdlSensor

ARight: TSdlSensor

Returns

Boolean


Equal(TSdlSensor, Pointer)

Used to compare against nil.

class operator Equal(const ALeft: TSdlSensor; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlSensor

ARight: Pointer

Returns

Boolean


Implicit(Pointer)

Used to set the value to nil.

class operator Implicit(const AValue: Pointer): TSdlSensor; inline; static

Parameters

AValue: Pointer

Returns

TSdlSensor


NotEqual(TSdlSensor, TSdlSensor)

Used to compare against another TSdlSensor.

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

Parameters

ALeft: TSdlSensor

ARight: TSdlSensor

Returns

Boolean


NotEqual(TSdlSensor, Pointer)

Used to compare against nil.

class operator NotEqual(const ALeft: TSdlSensor; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlSensor

ARight: Pointer

Returns

Boolean


Method Descriptions

Close

Close the sensor previously opened with Open.

procedure Close; inline


FromID(TSdlSensorID)

Return the snsor associated with an opened instance ID.

class function FromID(const AInstanceID: TSdlSensorID): TSdlSensor; inline; static

Exceptions

ESdlError: Raised on failure.

Parameters

AInstanceID: TSdlSensorID : The sensor instance ID.

Returns

TSdlSensor: The sensor.


GetSensorData(TArray<Single>)

Get the current state of the opened sensor.

The number of values and interpretation of the data is sensor dependent. The length of the AData array is the maximum number of values that will be written to the array.

procedure GetSensorData(const AData: TArray<Single>); inline

Exceptions

ESdlError: Raised on failure.

Parameters

AData: TArray<Single> : An array filled with the current sensor state.


Open(TSdlSensorID)

Open a sensor for use.

class function Open(const AInstanceID: TSdlSensorID): TSdlSensor; inline; static

Exceptions

ESdlError: Raised on failure.

Parameters

AInstanceID: TSdlSensorID : The sensor instance ID.

Returns

TSdlSensor: The sensor.


Update

Update the current state of the open sensors.

This is called automatically by the event loop if sensor events are enabled.

This needs to be called from the thread that initialized the sensor subsystem.

class procedure Update; inline; static