Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bge.types.SCA_PythonJoystick.rst « bge_types « rst « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8867ee7f962509aadd4e508719ec90659e9d21e (plain)
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
SCA_PythonJoystick(PyObjectPlus)
================================

base class --- :class:`PyObjectPlus`

.. class:: SCA_PythonJoystick(PyObjectPlus)

   A Python interface to a joystick.

   .. attribute:: name

      The name assigned to the joystick by the operating system. (read-only)

      :type: string

   .. attribute:: activeButtons

      A list of active button values. (read-only)

      :type: list

   .. attribute:: axisValues

      The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only).

      :type: list of ints.

      Each specifying the value of an axis between -1.0 and 1.0
      depending on how far the axis is pushed, 0 for nothing.
      The first 2 values are used by most joysticks and gamepads for directional control.
      3rd and 4th values are only on some joysticks and can be used for arbitary controls.

      * left:[-1.0, 0.0, ...]
      * right:[1.0, 0.0, ...]
      * up:[0.0, -1.0, ...]
      * down:[0.0, 1.0, ...]

   .. attribute:: hatValues

      The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).

      :type: list of ints

      Each specifying the direction of the hat from 1 to 12, 0 when inactive.

      Hat directions are as follows...

      * 0:None
      * 1:Up
      * 2:Right
      * 4:Down
      * 8:Left
      * 3:Up - Right
      * 6:Down - Right
      * 12:Down - Left
      * 9:Up - Left

   .. attribute:: numAxis

      The number of axes for the joystick at this index. (read-only).

      :type: integer

   .. attribute:: numButtons

      The number of buttons for the joystick at this index. (read-only).

      :type: integer

   .. attribute:: numHats

      The number of hats for the joystick at this index. (read-only).

      :type: integer