Difference between revisions of "Joystick"
(→ScanForJoysticks) |
(→Functions) |
||
Line 1: | Line 1: | ||
== Functions == | == Functions == | ||
− | === | + | |
+ | === GetJoystickAxisBind === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickAxisBind(joyindex, axisindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
− | |||
'''Arguments:''' | '''Arguments:''' | ||
<br> | <br> | ||
− | |||
− | |||
'''Returns:''' | '''Returns:''' | ||
<br> | <br> | ||
? | ? | ||
− | + | <br> | |
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
Line 20: | Line 18: | ||
− | === | + | === GetJoystickAxisInvert === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickAxisInvert(joyindex) -> ? | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 39: | Line 27: | ||
'''Arguments:''' | '''Arguments:''' | ||
<br> | <br> | ||
− | |||
− | |||
− | |||
<br> | <br> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Returns:''' | '''Returns:''' | ||
<br> | <br> | ||
Line 87: | Line 54: | ||
'''joyinfo''' - table with joystick information:<br> | '''joyinfo''' - table with joystick information:<br> | ||
− | joyinfo[ | + | joyinfo[axisindex] - values for each axis<br> |
joyinfo.Name - name of joystick shown in options<br> | joyinfo.Name - name of joystick shown in options<br> | ||
joyinfo.AxisNames - table with names of axis<br> | joyinfo.AxisNames - table with names of axis<br> | ||
Line 98: | Line 65: | ||
<br><br> | <br><br> | ||
− | === | + | === GetJoystickNumAxes === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickNumAxes(joyindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 107: | Line 74: | ||
'''Arguments:''' | '''Arguments:''' | ||
<br> | <br> | ||
− | + | <br> | |
− | + | ||
'''Returns:''' | '''Returns:''' | ||
<br> | <br> | ||
? | ? | ||
− | + | <br> | |
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
Line 118: | Line 84: | ||
− | === | + | === GetJoystickNumButtons === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickNumButtons(joyindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 126: | Line 92: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
Line 138: | Line 102: | ||
− | === | + | === GetJoystickNumPOVs === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickNumPOVs(joyindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 146: | Line 110: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
Line 157: | Line 119: | ||
− | + | === GetJoystickSingleAxisCenter === | |
− | === | + | |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleAxisCenter(joyindex, axisindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 166: | Line 127: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
Line 177: | Line 136: | ||
− | + | === GetJoystickSingleAxisDeadZone === | |
− | === | + | |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleAxisDeadZone(joyindex, axisindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 186: | Line 144: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
Line 197: | Line 153: | ||
− | + | === GetJoystickSingleAxisInvert === | |
− | === | + | |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleAxisInvert(joyindex, axisindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 206: | Line 161: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
Line 218: | Line 171: | ||
− | === | + | === GetJoystickSingleAxisRawValue === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleAxisRawValue(joyindex, axisindex) -> int value | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 226: | Line 179: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
<br> | <br> | ||
− | + | '''value''' - position of the joystick in -1000 to 1000 range | |
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
Line 238: | Line 189: | ||
− | === | + | === GetJoystickSingleAxisSaturation === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleAxisSaturation(joyindex, axisindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 257: | Line 208: | ||
− | + | === GetJoystickSingleAxisSettings === | |
− | === | + | |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleAxisSettings(joyindex, axisindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 266: | Line 216: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | + | ||
− | + | ||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
Line 277: | Line 226: | ||
− | + | === GetJoystickSingleAxisValue === | |
− | === | + | |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleAxisValue(joyindex, axisindex) -> int value | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 287: | Line 235: | ||
'''Arguments:''' | '''Arguments:''' | ||
<br> | <br> | ||
− | + | <br> | |
− | + | ||
'''Returns:''' | '''Returns:''' | ||
<br> | <br> | ||
− | + | '''value''' - position of the joystick in -1000 to 1000 range (for me it's same as raw value) | |
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
Line 298: | Line 245: | ||
− | === | + | === GetJoystickSingleButtonValue === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSingleButtonValue(joyindex, buttonindex) -> int buttonstate | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 306: | Line 253: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
<br> | <br> | ||
− | + | '''buttonstate''' - state of the button (for me 0 - not pressed, 128 - pressed) | |
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
Line 318: | Line 263: | ||
− | === | + | === GetJoystickSinglePOVValue === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | GetJoystickSinglePOVValue(joyindex, povindex) -> ? | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 327: | Line 272: | ||
'''Arguments:''' | '''Arguments:''' | ||
<br> | <br> | ||
− | + | <br> | |
− | + | ||
'''Returns:''' | '''Returns:''' | ||
<br> | <br> | ||
Line 338: | Line 282: | ||
− | === | + | === ScanForJoysticks === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | ScanForJoysticks() -> nil | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
+ | Detects connected joysticks | ||
+ | <br><br> | ||
+ | === SetJoystickSingleAxisCenter === | ||
+ | '''Definition:'''<br> | ||
+ | SetJoystickSingleAxisCenter(joyindex, axisindex, value) -> nil | ||
<br><br> | <br><br> | ||
− | ''' | + | '''Description:''' <br> |
− | <br> | + | |
− | + | ||
<br><br> | <br><br> | ||
− | ''' | + | '''Arguments:''' |
− | + | ||
− | + | ||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
Line 358: | Line 304: | ||
− | === | + | === SetJoystickSingleAxisDeadZone === |
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | + | joystick.SetJoystickSingleAxisDeadZone(joyindex, axisindex, leftdeadzone, rightdeadzone) -> nil | |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 366: | Line 312: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> | ||
+ | |||
Line 380: | Line 321: | ||
=== SetJoystickSingleAxisInvert === | === SetJoystickSingleAxisInvert === | ||
'''Definition:'''<br> | '''Definition:'''<br> | ||
− | SetJoystickSingleAxisInvert() -> ? | + | SetJoystickSingleAxisInvert(joyindex, axisindex) -> ? |
<br><br> | <br><br> | ||
'''Description:''' <br> | '''Description:''' <br> | ||
Line 386: | Line 327: | ||
<br><br> | <br><br> | ||
'''Arguments:''' | '''Arguments:''' | ||
− | |||
− | |||
<br><br> | <br><br> | ||
'''Returns:''' | '''Returns:''' | ||
Line 393: | Line 332: | ||
? | ? | ||
<br><br> | <br><br> | ||
+ | '''Example:''' | ||
+ | <br><br> | ||
+ | |||
+ | |||
+ | === SetJoystickSingleAxisSaturation === | ||
+ | '''Definition:'''<br> | ||
+ | joystick.SetJoystickSingleAxisSaturation(joyindex, axisindex, leftsat, rightsat) -> nil | ||
+ | <br><br> | ||
+ | '''Description:''' <br> | ||
+ | |||
+ | <br><br> | ||
+ | '''Arguments:''' | ||
+ | <br><br> | ||
+ | |||
'''Example:''' | '''Example:''' | ||
<br><br> | <br><br> |
Revision as of 18:27, 14 January 2009
Contents
- 1 Functions
- 1.1 GetJoystickAxisBind
- 1.2 GetJoystickAxisInvert
- 1.3 GetJoystickData
- 1.4 GetJoystickNumAxes
- 1.5 GetJoystickNumButtons
- 1.6 GetJoystickNumPOVs
- 1.7 GetJoystickSingleAxisCenter
- 1.8 GetJoystickSingleAxisDeadZone
- 1.9 GetJoystickSingleAxisInvert
- 1.10 GetJoystickSingleAxisRawValue
- 1.11 GetJoystickSingleAxisSaturation
- 1.12 GetJoystickSingleAxisSettings
- 1.13 GetJoystickSingleAxisValue
- 1.14 GetJoystickSingleButtonValue
- 1.15 GetJoystickSinglePOVValue
- 1.16 ScanForJoysticks
- 1.17 SetJoystickSingleAxisCenter
- 1.18 SetJoystickSingleAxisDeadZone
- 1.19 SetJoystickSingleAxisInvert
- 1.20 SetJoystickSingleAxisSaturation
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
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: