Difference between revisions of "cock.convertJoystickHat"

(Created page with "Converts literal to numerical joystick hat names and vice versa. == Function == === Synopsis === <source lang="Lua">converted = cock.convertJoystickHat ( input, forceliteral )</s...")
 
m
 
Line 15: Line 15:
 
*[[cock.remapJoystickHat]]
 
*[[cock.remapJoystickHat]]
 
*[[Common Organization of Controls Kit Input devices]]
 
*[[Common Organization of Controls Kit Input devices]]
*[[Common Organization of Controls Kit Manual]]
+
*[[parent::Common Organization of Controls Kit Manual]]
 +
[[Category:Functions]]
 +
*[[Common Organization of Controls Kit]]
 +
 
 +
{{#set:Description=Converts joystick hat.}}

Latest revision as of 18:19, 2 September 2013

Converts literal to numerical joystick hat names and vice versa.

Function

Synopsis

converted = cock.convertJoystickHat ( input, forceliteral )

Arguments

number input
Joystick hat name, numerical or literal.
boolean forceliteral
Optional. Forces literal ("true") or numerical ("false") output. Will perform conversion regardless if not provided.

Returns

string converted
Converted joystick hat.

Remarks

Function will make no change if it was supplied with literal input and forced to output literal value. Same for numerical values.

Unlike cock.convertDevice, this function aims specifically at joystick hats. It converts hat name to hat number rather than device number. E.g. "joystick hat 3" converted to "3" and vice versa, and not to "8" as with convertDevice function.

See also