This is the first attempt to support joysticks on RISC OS 5.
It is done by supplying a module, called Joystick, which provides the
same calls as the Joystick module on RISC OS 3.
The Joystick module simulates all calls necessary to use joysticks
from any language, including BASIC. If you are a programmer,
read the technical notes.
Please note that Joystick support is only available to registered users.
|
The Joystick window can be opened by selecting Joystick from the
iconbar menu. A window, similar to the one shown here, will be opened,
showing the current state of the first joystick connected to the system.
The title bar shows the total number of joysticks 'seen' by the system
and the menu at the top of the window allows you to select the joystick
you want to monitor.
The window is divided into several blocks. The large block at the left
shows the current X and Y position of the joystick. If the joystick
also has an Z-axis, it will be shown in the next box (the leftmost one
of the smaller boxes). The other boxes show the Hat switch, the Slider
and the Z-Rotation of the joystick, which may or may not be available
on your device.
|
|
|
Below the 4 smaller boxes is a wide box, showing the current state of
the buttons. Older versions of RISC OS only support the lowest 8 buttons.
!HID however will recognise up to 32 buttons, the first 16 of which are
shown in this window. The first button is represented by a red LED, as
it is generally used as the fire button. The other buttons are represented
by yellow LEDs.
|
|
|
If you have only one joystick connected to your computer, it will be
shown immediately in this window. However, if you have connected multiple
joysticks to your system, only the first one 'seen' by the computer will
be shown. The menu at the top of the window can be used to select any
of the other joysticks.
|
Most analogue joysticks contain potentiometers to detect horizontal and
vertical movement. As potentiometers are generally rather inaccurate, it
may be necessary to calibrate the joysticks before use.
From RISC OS 3.6 onwards it is possibleto calibrate the joysticks before
use. Whether or not your joystick needs calibration, depends entirely
on the model you've bought. Some modern joysticks and gamepads are
pre-calibrated so they don't require additional calibration.
When a joystick is connected, the systems assumes it is pre-calibrated.
This is shown by a yellow LED at the left of the window.
Once you start the calibration process is started the LED will
become red to indicate that the calibration process needs to be
completed before joysticks can be used again. Once calibration has
been completed, the LED will turn green.
You may return to the default state (i.e. uncalibrated) by Adjust-clicking
any of the calibration buttons in the window.
If your joystick hasn't been pre-calibrated, you are likely to see some
random movement. There are several ways to calibrate your joystick now:
Method 1: Using the calibration buttons
Put all joystick controls in the bottom left position and click
the Bottom left button. Next, put all controls in the top right
position and click the Top right button. If all goes well, the joystick
will now be calibrated and the LED will turn green.
Method 2: Using the fire button
It may be easier to use the interactive Calibration feature of !HID.
Click the Calibrate button at the bottom of the window. The button
will be highlighted during the calibration process and the help line
(at the bottom of the window) will guide you through the process.
Put the joystick controls in the bottom left position and press
the fire buttom. Next put the joystick controls in the top right
position and press the fire buttom again. This completes the calibration
and the LED should turn green.
Yo may repeat this process as often as you like.
You may
calibrate all joysticks simultaneously, by setting the All switch.
The calibration buttons will be be highlighted by a read bar to show that
you are addressing all joysticks simultaneously. You may now use any of
the calibration methods described above.
|
The joystick can be used to simulate a mouse.
At present only the first joystick 'seen' by the system can be used
for this. Furthermore, the joystick must be calibrated before it can
be used as a mouse. If your joystick is pre-calibrated, click the
red flashing LED to 'fake' calibration.
Mouse simulation can be enabled by setting the Mouse switch in the
bottom left of the window. Mouse simulation can be enabled permanently
in the Choices... window (see below).
Please note that when the joystick hasn't been properly calibrated, the
pointer may move off-screen and you may not be able to use the mouse
anymore. If this happens by accident, press F12 and type:
*Joystick_Mouse 0 , then press Return twice.
|
Configuring joystick usage
|
 |
 |
 |
Global joystick usage can be configured from the Choices window.
After selecting Choices... from the iconbar menu a window,
similar to the one shown here, will open.
At present only a few options are available.
Enable Joystick support
This switch is used to turn joystick support on or off.
When joystick support is enabled (i.e. the switch is on),
the Jostick module will be launched and can be accessed from
any program with suitable support for the Joystick module.
Calibrate all joysticks
When this switch is on, the switch All in the Joystick window will
be on by default. The calibration buttons will then function on all
joysticks simultaneously. When off, each joystick needs to be calibrated
individually.
|
|
|
Fake calibration
Depending on the type and model of joystick, it may or may not require
calibration. There is no way for the software to find out whether or not
the device needs calibration. If the joysticks you are using are
pre-calibrated, you may 'fake' calibration by ticking this switch.
!HID will then be forced to 'think' that the calibration process has
already been carried out. A joystick is pre-calibrated when it produces
the correct full-range values immediately when it is connected.
Simulate mouse
You may want to use a joystick as a pointing device and move the mouse
pointer on the screen. By selecting Simulate mouse, the first joystick
can be used to move the mouse. The first three buttons will be used as
the standard three mouse buttons: Select, Menu and Adjust.
In addition, the mouse will remain active.
See also the heading Mouse simulation above.
|
|
|
© Copyright Paul Reuvers
X-Ample Technology bv
usb@xat.nl
Last changed: Last changed: Thursday, 12 August 2004 - 11:44 CET.
|
|