Difference between revisions of "cock.convertKey"
(Created page with "Conditionally converts literal to numerical input key names and vice versa. Essentially, performs cock.convertAxis if device was axis-like, otherwise returns unchanged input....") |
|||
(2 intermediate revisions by the same user not shown) | |||
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 | + | {{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 === | ||
Line 15: | Line 15: | ||
*[[cock.convertAxis]] | *[[cock.convertAxis]] | ||
*[[Common Organization of Controls Kit Input devices]] | *[[Common Organization of Controls Kit Input devices]] | ||
− | *[[Common Organization of Controls Kit Manual]] | + | *[[Common Organization of Controls Kit Input keys]] |
+ | *[[parent::Common Organization of Controls Kit Manual]] | ||
+ | [[Category:Functions]] | ||
+ | *[[Common Organization of Controls Kit]] | ||
+ | |||
+ | {{#set:Description=Converts key.}} |
Latest revision as of 18:20, 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
- cock.convertDevice
- cock.convertAxis
- Common Organization of Controls Kit Input devices
- Common Organization of Controls Kit Input keys
- Common Organization of Controls Kit Manual
- Common Organization of Controls Kit