Difference between revisions of "cock.addJoystick"

m
m
 
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 ===

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