-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjoystick.lua
More file actions
106 lines (89 loc) · 3.5 KB
/
Copy pathjoystick.lua
File metadata and controls
106 lines (89 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
-- Provides an interface to the user's joystick.
--
-- @module joystick
--
---
-- Closes a joystick, i.e. stop using it for generating events and in query functions.
-- @function [parent = #joystick] close
-- @param #number joystick The joystick to be closed
---
-- Returns the position of each axis.
-- @function [parent = #joystick] getAxes
-- @param #number joystick The joystick to be checked
-- @return #number axisDir1 Direction of axis1
-- @return #number axisDir2 Direction of axis2
-- @return #number axisDirN Direction of axisN
---
-- Returns the direction of the axis.
-- @function [parent = #joystick] getAxis
-- @param #number joystick The joystick to be checked
-- @param #number axis The axis to be checked
-- @return #number direction Current value of the axis
---
-- Returns the change in Ball position.
-- @function [parent = #joystick] getBall
-- @param #number joystick The joystick to be checked
-- @param #number ball The ball to be checked
-- @return #number dx Change in x of the ball position.
-- @return #number dy Change in y of the ball position.
---
-- Returns the direction of a hat.
-- @function [parent = #joystick] getHat
-- @param #number joystick The joystick to be checked
-- @param #number hat The hat to be checked
-- @return direction The direction the hat is pushed
---
-- Returns the name of a joystick.
-- @function [parent = #joystick] getName
-- @param #number joystick The joystick to be checked
-- @return #string name The name
---
-- Returns the number of axes on the joystick.
-- @function [parent = #joystick] getNumAxes
-- @param #number joystick The joystick to be checked
-- @return #number axes The number of axes available
---
-- Returns the number of balls on the joystick.
-- @function [parent = #joystick] getNumBalls
-- @param #number joystick The joystick to be checked
-- @return #number balls The number of balls available
---
-- Returns the number of buttons on the joystick.
-- @function [parent = #joystick] getNumButtons
-- @param #number joystick The joystick to be checked
-- @return #number buttons The number of buttons available
---
-- Returns the number of hats on the joystick.
-- @function [parent = #joystick] getNumHats
-- @param #number joystick The joystick to be checked
-- @return #number hats How many hats the joystick has
---
-- Returns how many joysticks are available.
-- @function [parent = #joystick] getNumjoysticks
-- @return #number joysticks The number of joysticks available
---
-- Checks if a button on a joystick is pressed.
-- @function [parent = #joystick] isDown
-- @param #number joystick The joystick to be checked
-- @param #number button The button to be checked
-- @return #boolean down True if the button is down, false if it is not
---
-- Checks if a button on a joystick is pressed.
-- @function [parent = #joystick] isDown
-- @param #number joystick The joystick to be checked
-- @param #number button1 A button to check
-- @param #number button2 A button to check
-- @param #number ... Additional button(s) to check
-- @return #boolean anyDown True if any supplied button is down, false if not.
---
-- Checks if the joystick is open.
-- @function [parent = #joystick] isOpen
-- @param #number joystick The joystick to be checked
-- #return #boolean open True if the joystick is open, false if it is closed.
---
-- Opens up a joystick to be used, i.e. makes it ready to use. By default joysticks that are
-- available at the start of your game will be opened.
-- @function [parent = #joystick] open
-- @param #number joystick The joystick to be opened
return nil