Joystick

From Vendetta Lua
Jump to navigationJump to search

Functions

GetJoystickAxisBind

Definition:
GetJoystickAxisBind(joyindex, axisindex) -> ?

Description:

Arguments:
Returns:
?
Example:


GetJoystickAxisInvert

Definition:
GetJoystickAxisInvert(joyindex) -> ?

Description:



Arguments:

Returns:
?

Example:


GetJoystickData

Definition:
GetJoystickData(int joyindex) -> table joyinfo

Description:

Arguments:

int joyindex - index of the joystick, starts at 0


Returns:

joyinfo - table with joystick information:
joyinfo[axisindex] - values for each axis, indicies start at 1
joyinfo.Name - name of joystick shown in options
joyinfo.AxisNames - table with names of axis
joyinfo.Buttons - table with state of buttons (i get 128 for pressed, 0 for released)
joyinfo.index - joyindex
joyinfo.POV - table with state of POV switches, -1 for center, otherwise angle, (i get 0 for upwards, 90 for right, etc.)


Example:

GetJoystickNumAxes

Definition:
GetJoystickNumAxes(joyindex) -> ?

Description:



Arguments:

Returns:
?
Example:


GetJoystickNumButtons

Definition:
GetJoystickNumButtons(joyindex) -> ?

Description:



Arguments:

Returns:
?

Example:


GetJoystickNumPOVs

Definition:
GetJoystickNumPOVs(joyindex) -> ?

Description:



Arguments:

Returns:
?

Example:


GetJoystickSingleAxisCenter

Definition:
GetJoystickSingleAxisCenter(joyindex, axisindex) -> ?

Description:



Arguments:

Returns:
?

Example:


GetJoystickSingleAxisDeadZone

Definition:
GetJoystickSingleAxisDeadZone(joyindex, axisindex) -> ?

Description:



Arguments:

Returns:
?

Example:


GetJoystickSingleAxisInvert

Definition:
GetJoystickSingleAxisInvert(joyindex, axisindex) -> ?

Description:



Arguments:

Returns:
?

Example:


GetJoystickSingleAxisRawValue

Definition:
GetJoystickSingleAxisRawValue(joyindex, axisindex) -> int value

Description:



Arguments:

Returns:
value - position of the joystick in -1000 to 1000 range

Example:


GetJoystickSingleAxisSaturation

Definition:
GetJoystickSingleAxisSaturation(joyindex, axisindex) -> ?

Description:



Arguments:
?

Returns:
?

Example:


GetJoystickSingleAxisSettings

Definition:
GetJoystickSingleAxisSettings(joyindex, axisindex) -> ?

Description:



Arguments:



Returns:
?

Example:


GetJoystickSingleAxisValue

Definition:
GetJoystickSingleAxisValue(joyindex, axisindex) -> int value

Description:



Arguments:

Returns:
value - position of the joystick in -1000 to 1000 range (for me it's same as raw value)

Example:


GetJoystickSingleButtonValue

Definition:
GetJoystickSingleButtonValue(joyindex, buttonindex) -> int buttonstate

Description:



Arguments:

Returns:
buttonstate - state of the button (for me 0 - not pressed, 128 - pressed)

Example:


GetJoystickSinglePOVValue

Definition:
GetJoystickSinglePOVValue(joyindex, povindex) -> ?

Description:



Arguments:

Returns:
?

Example:


ScanForJoysticks

Definition:
ScanForJoysticks() -> nil

Description:
Detects connected joysticks

SetJoystickSingleAxisCenter

Definition:
SetJoystickSingleAxisCenter(joyindex, axisindex, value) -> nil

Description:



Arguments:

Example:


SetJoystickSingleAxisDeadZone

Definition:
joystick.SetJoystickSingleAxisDeadZone(joyindex, axisindex, leftdeadzone, rightdeadzone) -> nil

Description:



Arguments:

Example:



SetJoystickSingleAxisInvert

Definition:
SetJoystickSingleAxisInvert(joyindex, axisindex) -> ?

Description:



Arguments:

Returns:
?

Example:


SetJoystickSingleAxisSaturation

Definition:
joystick.SetJoystickSingleAxisSaturation(joyindex, axisindex, leftsat, rightsat) -> nil

Description:



Arguments:

Example: