Difference between revisions of "cock.addJoystick"

(Created page with "Adds new joystick to the object by given joystick number. == Synopsis == === Function === <source lang="Lua">joystick = cock.addJoystick ( self, number )</source> === Arguments =...")
 
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Adds new joystick to the object by given joystick number.
 
Adds new joystick to the object by given joystick number.
== Synopsis ==
+
== Function ==
=== Function ===
+
=== Synopsis ===
 
<source lang="Lua">joystick = cock.addJoystick ( self, number )</source>
 
<source lang="Lua">joystick = cock.addJoystick ( self, number )</source>
 
=== Arguments ===
 
=== Arguments ===
Line 8: Line 8:
 
=== Returns ===
 
=== Returns ===
 
{{param|number|joystick|Internal joystick number.}}
 
{{param|number|joystick|Internal joystick number.}}
 +
== Remarks ==
 +
If function fails to find specified joystick, it will create ''a dummy joystick''. It will represent virtual non-functional joystick. It will accept all joystick operaitons, but will not carry out any of them. Dummy joysticks do not yield any output. Function [[cock.reloadJoysticks]] will happily override dummy joysticks with real ones.
 +
 
==See also==
 
==See also==
 
*[[cock.deleteJoystick]]
 
*[[cock.deleteJoystick]]
 
*[[cock.setJoystickDeadzone]]
 
*[[cock.setJoystickDeadzone]]
 
*[[cock.reloadJoysticks]]
 
*[[cock.reloadJoysticks]]
 +
*[[Common Organization of Controls Kit Fields]]
 
*[[parent::Common Organization of Controls Kit Manual]]
 
*[[parent::Common Organization of Controls Kit Manual]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 14:50, 2 September 2013

Adds new joystick to the object by given joystick number.

Function

Synopsis

joystick = cock.addJoystick ( self, number )

Arguments

table self
An object to use.
number number
Optional. LÖVE joystick number to hook up. Will use 1 if not provided.

Returns

number joystick
Internal joystick number.

Remarks

If function fails to find specified joystick, it will create a dummy joystick. It will represent virtual non-functional joystick. It will accept all joystick operaitons, but will not carry out any of them. Dummy joysticks do not yield any output. Function cock.reloadJoysticks will happily override dummy joysticks with real ones.

See also