Skip to content

Commit

Permalink
Documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
fasteddy516 committed Aug 20, 2021
1 parent b427882 commit e546f30
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"digitalio",
"microcontroller",
"usb_hid",
"supervisor",
]
autodoc_typehints = "both"
autodoc_member_order = "bysource"
Expand Down
3 changes: 3 additions & 0 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ to 8 axes, 128 buttons and 4 hat (POV) switches. If you want to build a custom
game controller with a lot of inputs - *I'm looking at you, space/flight sim
pilots and racing sim drivers* - JoystickXL can help.

**Head over to the** :doc:`Getting Started </start>` **section to dive in!**


Requirements
============
Expand All @@ -46,6 +48,7 @@ with the following games:
* **Microsoft Flight Simulator (2020)** *(All inputs)*
* **Elite Dangerous** *(Limited to 32 buttons)*
* **Star Citizen** *(All inputs)*
* **Digital Combat Simulator (DCS) World** *(All inputs)*
* **Forza Horizon 4** *(All inputs)*
* **BeamNG.drive** *(Limited to 7 axes and 1 hat switch)*

Expand Down
33 changes: 30 additions & 3 deletions docs/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ When the test console loads up, you will be greeted with the following:
JoystickXL - Test Console
Using 1-based indexing.
Button Clicks = 0.25s"
Enter command (? for list)
:
Expand All @@ -96,8 +97,8 @@ the prompt and press enter. The avalable commands are:

* ``a`` : **Axis commands**

* ``[i]+`` : Momentarily set axis ``i`` to its maximum value. (ex. ``a1+``)
* ``[i]-`` : Momentarily set axis ``i`` to its minimum value. (ex. ``a4-``)
* ``[i]u`` : Move axis ``i`` from idle to its maximum value and back. (ex. ``a1u``)
* ``[i]d`` : Move axis ``i`` from idle to its minimum value and back. (ex. ``a4d``)
* ``t`` : Test all configured axes by simulating movement on them one at a time. (ex. ``at``)

* ``b`` : **Button commands**
Expand All @@ -111,11 +112,16 @@ the prompt and press enter. The avalable commands are:
* ``[i]d`` : Click hat switch ``i``'s ``DOWN`` button. (ex. ``h3d``)
* ``[i]l`` : Click hat switch ``i``'s ``LEFT`` button. (ex. ``h0l``)
* ``[i]r`` : Click hat switch ``i``'s ``RIGHT`` button. (ex. ``h2r``)
* ``[i]ul`` : Click hat switch ``i``'s ``UP+LEFT`` button. (ex. ``h1ul``)
* ``[i]ur`` : Click hat switch ``i``'s ``UP+RIGHT`` button. (ex. ``h3ur``)
* ``[i]dl`` : Click hat switch ``i``'s ``DOWN+LEFT`` button. (ex. ``h0dl``)
* ``[i]dr`` : Click hat switch ``i``'s ``DOWN+RIGHT`` button. (ex. ``h2dr``)
* ``t`` : Test all configured hat switches by clicking each position one at a time. (ex. ``ht``)

* ``t`` = Test all configured axes, buttons and hats by cycling through their states one at a time.
* ``0`` = Switch to 0-based indexing
* ``1`` = Switch to 1-based indexing
* ``p[t]`` = Set button press time. (ex. ``p150`` = 1.5 second button presses)
* ``q`` = Quit the test console

.. note::
Expand All @@ -137,7 +143,7 @@ that game's input configuration settings, select your JoystickXL device
(likely labelled ``CircuitPython HID``) and attempt to assign inputs to
functions. Ideally, the game uses a *click to assign* system where you
select the desired function, then move/click the input you want to assign to
it. If so, you can use the corresponding test console command (ex. ``a2+``,
it. If so, you can use the corresponding test console command (ex. ``a2u``,
``b7``, ``h3d``, etc.) to trigger the desired input and make sure it registers
in-game.

Expand All @@ -147,6 +153,27 @@ in-game.
application you want to test it with on your host. If you start the
application on the host first, it may not detect the joystick.

**If the application you are trying to test has to be in-focus to capture
joystick events** it will not capture events generated from the test console
because your serial terminal will be in-focus while you are typing in it.
For cases like these, the test console provides a single digital input - by
default on pin ``D2`` - which will repeat the last typed command when activated.
You can either hook up an actual button, or just short ``D2`` to ground to
trigger commands as needed. In the game example above, you would enter the
desired command in the test console and press enter, then switch to the game
and use the button input to trigger that command while the game is in focus.
If needed, the button pin can also be changed when the test console is started
as follows:

.. code-block:: text
Adafruit CircuitPython 7.0.0-alpha.5 on 2021-07-21; Adafruit QT Py M0 Haxpress with samd21e18
>>> import board
>>> from joystick_xl.tools import TestConsole
>>> TestConsole(button_pin = board.D7)
.. seealso::

**Joystick Testing Applications**
Expand Down

0 comments on commit e546f30

Please sign in to comment.