ABSOLUTE CONTROLLER LAB 1.5.0
ApeTheory - Admin for Absolute Gaming LLC - (c) Absolute Gaming LLC

Tests gamepads, flight sticks, throttles and pedals, and turns Absolute Gaming
Star Citizen forms into layout files. Everything runs on your computer; nothing
is uploaded.

HOW TO RUN
  Windows app (recommended): double-click AbsoluteControllerLab.exe.
            It opens in its own window and has every feature, including
            installing layouts into Star Citizen and backing up your bindings.
  Browser version (this folder):
    Option 1: Double-click "Start Controller Lab.bat".
              With Node.js installed it starts a small local server and opens
              the lab in your browser. Without Node.js it opens index.html directly.
    Option 2: Double-click index.html (Chrome, Edge or Firefox).
    Option 3: From a terminal in this folder:  node server.js
  Press any button on the controller so the browser can see it.

CONTROLLER TEST
  Button test     Every button lights up when pressed and gets a green tick once
                  it works. Double presses (switch bounce) get a red outline.
  Hats / POV      Shows hat switch direction when the device reports one.
  Axes            Live value, full travel range seen, and jitter (noise).
  Drift test      Hands off for 5 seconds. Reports resting offset, how far each
                  axis wanders, a verdict, and a suggested deadzone.
  Stick lab       Roll a stick around its edge for its outline, roundness and reach.
  Report rate     How often the device sends updates (wiggle a stick).
  Vibration       Weak / strong rumble test on gamepads that support it.
  Save report     Downloads a plain text report of the whole session.

STAR CITIZEN BINDINGS (new in 1.2.0)
  1. Press a button on each controller. The matching kit lights up: X56,
     SOL-R 2, SOL-R 4, G PRO yoke, Xbox, PS5, T.16000M dual or T.16000M + TWCS,
     VIRPIL CDT-AeroMax + VMAX Prime, or VIRPIL CDT-AeroMax dual sticks.
  2. Click "Get blank form". The app saves it in
     Documents\Absolute Controller Lab\Forms and opens it. Fill it in and save it.
  3. Drop the saved PDF on the app. Check the matches (fix any marked
     "Pick one" or "Check this"), name your profile, then click
     "Install into Star Citizen" or "Save XML file".
     The layout goes into StarCitizen\<LIVE/PTU/...>\user\client\0\controls\mappings.
  4. In game press ~ and run the pp_rebindkeys command the app shows, or pick
     the profile under Options > Keybindings > Control Profiles.
  Backups: "Back up" next to an install saves its bindings (actionmaps.xml)
  and saved layouts to Documents\Absolute Controller Lab\Backups. "Restore"
  puts a backup back, and always backs up what's there first. Close Star
  Citizen before restoring: the game rewrites its bindings when it exits.
  The app finds Star Citizen on its own (RSI launcher settings and the usual
  folders on every drive). If yours isn't listed, add its folder.
  The XML makers are the same ones the absolutegaming.store kit pages use. The
  app fetches them once and keeps a copy, so after the first run it works
  offline. The browser version can read forms and save the XML; installing
  and backups need the Windows app.

SETTINGS BACKUP
  Moves your whole Star Citizen setup from one PC to another, or back after a
  reinstall: bindings and saved layouts, game options (graphics, audio, FOV and
  the rest of attributes.xml), character presets, menu and inventory settings,
  and USER.cfg if you have one. Shader caches, logs and recordings are left out
  because the game rebuilds them.

  Set up once on each PC (Settings backup tab, top card):
    - Give the PC a name, for example "Intel rig" or "AMD rig".
    - Optional but easiest: set the same shared folder on every PC, for example
      a folder in Dropbox or OneDrive. Backups then show up on every PC by
      themselves. Without one, use "Save a copy" and "Add a backup file".

  A. On the PC you are moving FROM: close Star Citizen, pick the install and
     click "Back up <PC name>".
  B. On the PC you are moving TO: install Star Citizen, start it once to the
     main menu and exit. In "Restore onto this PC", pick the backup (listed by
     the PC it was made on), pick the install on this PC, tick what to
     restore and click "Review restore". The review shows FROM which PC, TO
     which PC and folder, and every file it will add or replace. Click
     "Restore now". What was there before is backed up first, so a restore can
     always be undone.

  If the stick and throttle come up swapped, press ~ in game and run
     pp_resortdevices joystick 1 2
  (i_DumpDeviceInformation lists the order the game found them in).
  Screen resolution and window mode come from the backed up PC; set them
  again in Options, Graphics if the new screen is different.

NOTES
  VIRPIL: the stock AeroMax R and VMAX Prime are recognised by their USB IDs.
  A stick renamed with an L- prefix in the VIRPIL software is recognised by
  name. For the RZ / LZ omni sticks, or anything shown wrong, pick the right
  picture under "Shown as".
  Browsers expose controllers through the Gamepad API. Very large devices may
  show fewer buttons or axes than Windows does, depending on the browser.
  Report rate is measured by polling, so treat it as approximate.
  The PDF reader is pdf-lib (MIT license, (c) 2019 Andrew Dillon).
