Skip to content

Configurable USB Joystick interface #2

@banyaszg

Description

@banyaszg

Motivation

The existing USB HID Joystick interface is a static one. The device acts as a GamePad. The first 8 channels are handled as axes (X, Y, Z, rotX, rotY, rotZ, slider, slider), and the remaining 24 channels reported as push buttons.
There is a potential in the radios to be a full featured sim/game controllers, but there are issues:

  • The switches are mainly unusable in the games, because the current push button emulation lacks a lot of features.
  • Some operating systems and softwares handle axes differently. Sometimes they allow only one from a type like "slider", or they can not handle some axes. So selecting from a wider list could handle this problem.

Overview

In this implementation we can define a USB interface for each models. (Cuurently only 128x64 BW GUI supported.)
These are the settings:

  • In the model settings the Classic and the Advanced USB Joystick interface can be selected. All the other settings will open for the "Advanced" selection.
  • The type of the USB interface can be selected (Joystick, Gamepad, Multiaxis)
  • There is a USB Joystick interface configuration button, which opens the USB Joystick menu:
  • The mode of each mixer channels can be configured:
    • "None" - means disabled
    • "Button" - used for each type of buttons
      • The type of the switch (the number of positions) can be: Push, 2POS, 3POS, ... 8POS
    • There are general axes: X, Y, Z, rotX, rotY, rotZ, slider, dial, wheel - usually the games use these
    • There are simulation type axes: aileron, elevator, rudder, throttle - usually only the throttle is used by the games
  • Inversion can be set for each channel. It inverts the value before the report to the PC.
  • To prevent button reordering the device preallocates a lot of buttons (currently 32), and they can be selected for each button type channels.
  • During the USB Joystick connection the settings are disabled / hided.
  • If there is a model selection during the USB Joystick connection, then the system checks whether the new model uses the same USB interface as the old one. If they differ, then a software disconnection-replug occurs to refresh the settings to the new model.

TODO

  • Companion support

Future plans

  • Hat switch support. The trims could be part of a hat switch simulation.
  • Additional axis settings:
    • Circular cutout
  • Advanced button / switch settings.
    • And option to extend the button number further. Old games doesn't support more than 32 buttons, so a second virtual controller is needed. Newer games can support them in the same device.
    • Edge signal: When the switching occurs there is only a brief on state for the button. Vrtually it can be one push button, or several ones to represent the state also.
    • One edge: only one direction generates a brief impulse.
    • Switch emulation: the physical push button toggles the state of the virtual push button.
    • Two direction buttons from an analog channel: The delta of the analog channel value represents two directional button.
    • Trim switches as buttons. Perhaps the analog delta could be used for this .. further investigation is needed.
    • ? Key emulation
  • ? There could be a script interface.
  • Using the display
    • ? The radio could emulate a LED interface to the PC, and display the signals.
    • For the color gui there could be soft buttons on the display, and several tabs based on switch states. Those could be collections for different game activities. Also there could be user defined skins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions