Difference between revisions of "cock.convertKey"

m (See also)
m
Line 5: Line 5:
 
=== Arguments ===
 
=== Arguments ===
 
{{param|number|device|Input [[Common Organization of Controls Kit Input devices|device]], numerical or literal.}}
 
{{param|number|device|Input [[Common Organization of Controls Kit Input devices|device]], numerical or literal.}}
{{param|number|input|Input [[Common Organization of Controls Kit Input devices|key]], numerical or literal.}}
+
{{param|number|input|Input [[Common Organization of Controls Kit Input keys|key]], numerical or literal.}}
 
{{param|boolean|forceliteral|Optional. Forces literal ("true") or numerical ("false") output. Will perform conversion regardless if not provided.}}
 
{{param|boolean|forceliteral|Optional. Forces literal ("true") or numerical ("false") output. Will perform conversion regardless if not provided.}}
 
=== Returns ===
 
=== Returns ===

Revision as of 18:09, 2 September 2013

Conditionally converts literal to numerical input key names and vice versa. Essentially, performs cock.convertAxis if device was axis-like, otherwise returns unchanged input.

Function

Synopsis

converted = cock.convertKey ( device, input, forceliteral )

Arguments

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

Returns

string converted
Converted input key.

Remarks

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

See also