The interactive controls page was a static picture of the stock layout -- a
player's carried migration rows, rebinds and HOTAS setup were invisible to it,
and the mismatch grew with every customization. Now a "Load your bindings.txt"
box (file picker + drag-drop) parses the real bindings grammar client-side and
rewrites the interactive keyboard in place:
* every key shows the loaded file's truth; keys that differ from the stock
board get a hazard outline (the legend says so); hover readouts follow
because they were already attribute-driven;
* the game's bindings-row-wins rule is modelled: the PgUp/PgDn volume and
backtick view BUILT-INS keep their face only while their key is unbound;
* rows that have no keyboard geometry (pad / padaxis / wizard joyaxis-
joybutton-joyhat / MOUSE keys) land in an "also in your file" list;
* one click restores the stock view. Nothing is uploaded -- FileReader on a
user-chosen local file, works from the extracted zip on file://.
Key-name registry walks the three key blocks in DOM order (Shift/Ctrl/Alt
resolve left-then-right; the numpad's U+2212 minus and its ASCII twin both map
to NUMPADMINUS), address meanings are harvested from the stock board itself
plus a small table for the slots the default board leaves off (unwired columns,
the cabinet-only throttle bank, PANIC).
Two self-inflicted bugs found by the harness and fixed before landing: the
address harvest invented a "BTN" label for the many stock keys that have none,
which made EVERY default row read as a customization; and generated axis labels
("AIM +") differed from the page's hand-authored vocabulary ("AIM UP"), custom-
marking the whole stock numpad. Both now speak the board's own labels.
VERIFIED headlessly (no browser extension needed): scratchpad/
test_controls_page.py injects a self-test harness into a copy of the page,
feeds it scratchpad/fixture_migrated_bindings.txt -- a REAL board-2 migrated
file (full defaults + two authored rows + a wizard section) -- and runs it
under chrome --headless=new --dump-dom. 11/11: the two authored rows carried
and marked, zero stray custom marks across the rest of the board, both
built-ins survive, wizard rows listed, status line honest, and reset restores
the stock board exactly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
197 lines
7.4 KiB
Plaintext
197 lines
7.4 KiB
Plaintext
# bindings-board 2 -- KEEP THIS LINE. It marks the keyboard-layout generation;
|
|
# files without it are pre-board layouts and are migrated automatically
|
|
# (your own rows and the joystick wizard section are kept, the obsolete old
|
|
# defaults are replaced, and the previous file is saved as bindings.old.txt).
|
|
#
|
|
# bindings.txt -- PadRIO input bindings (glass cockpit). Auto-written with
|
|
# defaults on first run; edit freely, delete to regenerate. Grammar:
|
|
# key <KEYNAME> button <addr> RIO button (hex 0x.. ok)
|
|
# key <KEYNAME> keypad <unit> <key> MFD keypad unit 0-2, key 0-15
|
|
# key <KEYNAME> axis <channel> deflect <+|-> <rate> spring stick
|
|
# key <KEYNAME> axis <channel> slew <+|-> <rate> throttle lever
|
|
# key <KEYNAME> axis <channel> set <value> jump/detent
|
|
# pad <PADBTN> button <addr>
|
|
# padaxis <PADAXIS> axis <channel> [invert] [slew <rate>]
|
|
# <KEYNAME> may be a MOUSE BUTTON: MOUSEMIDDLE, MOUSE4, MOUSE5 (the two
|
|
# side buttons; MOUSEX1/MOUSEX2 are aliases). MOUSELEFT and MOUSERIGHT
|
|
# also work but are how you press cockpit buttons -- bind them and they
|
|
# fire on every panel click too. Mouse MOVEMENT is not bindable.
|
|
# Channels: Throttle JoystickX JoystickY LeftPedal RightPedal Turn
|
|
# (Turn = signed composite: + drives the right pedal, - the left --
|
|
# made for mapping a gamepad stick to turning)
|
|
# Pad buttons: A B X Y LB RB BACK START LS RS DPAD_* Axes: LX LY RX RY LT RT
|
|
#
|
|
# LAYOUT: THE KEYBOARD IS THE POD'S BUTTON BOARD. The letter and number
|
|
# rows are the MFD button banks laid out where they sit on the panel, and
|
|
# flight lives on the numpad so the board stays free. Every one of the 72
|
|
# pod buttons is also one mouse click away on the cockpit itself
|
|
# (right-click = press-and-hold latch).
|
|
#
|
|
# A key bound here is REMOVED from the authentic 1995 typed-hotkey channel
|
|
# so it cannot double-dispatch -- and this board binds nearly everything,
|
|
# so those hotkeys (5 = MFD1 Quad, z = MFD3 Eng1, t/y/u/i/o = pilot select,
|
|
# +/- = target zoom) are given up by design. Unbind a key here to get its
|
|
# 1995 meaning back. Same rule for the built-ins: BACKTICK = view toggle
|
|
# (V is a board button now), and J/K/L cycle the Mfd1/2/3 preset pages ONLY
|
|
# while unbound.
|
|
|
|
# --- flight: the numpad ------------------------------------------------
|
|
# 8/2/4/6 stick, 7/9 pedals, 5 all-stop detent, 0 main trigger.
|
|
# SHIFT/CTRL walk the throttle lever and it STICKS where you leave it;
|
|
# ALT is the throttle handle's reverse-thrust button.
|
|
key NUMPAD8 axis JoystickY deflect + 2.5
|
|
key NUMPAD2 axis JoystickY deflect - 2.5
|
|
key NUMPAD4 axis JoystickX deflect - 2.5
|
|
key NUMPAD6 axis JoystickX deflect + 2.5
|
|
key NUMPAD7 axis LeftPedal deflect + 2.5
|
|
key NUMPAD9 axis RightPedal deflect + 2.5
|
|
key NUMPAD5 axis Throttle set 0
|
|
key LSHIFT axis Throttle slew + 0.7
|
|
key RSHIFT axis Throttle slew + 0.7
|
|
key LCTRL axis Throttle slew - 0.7
|
|
key RCTRL axis Throttle slew - 0.7
|
|
key LALT button 0x3F
|
|
key RALT button 0x3F
|
|
|
|
# PgUp/PgDn are the VOLUME keys (built in; they produce no typed character
|
|
# so they can never collide with a hotkey) -- leave them unbound.
|
|
|
|
# --- the four mappable fire buttons ------------------------------------
|
|
# The mouse's side buttons are free if you want them on the trigger:
|
|
# key MOUSE4 button 0x40
|
|
# key MOUSE5 button 0x46
|
|
# key MOUSEMIDDLE button 0x41
|
|
key SPACE button 0x40 # main trigger
|
|
key NUMPAD0 button 0x40 # main trigger
|
|
key NUMPAD1 button 0x45 # pinky
|
|
key NUMPAD3 button 0x46 # middle thumb
|
|
key NUMPADDOT button 0x47 # upper thumb
|
|
|
|
# --- the hat: look around, on the arrows -------------------------------
|
|
key UP button 0x42 # torso CENTER (the shipped .RES name)
|
|
key DOWN button 0x41 # look behind
|
|
key LEFT button 0x44 # look left
|
|
key RIGHT button 0x43 # look right
|
|
|
|
# --- UPPER MFD banks: number row on top, QWERTY beneath ----------------
|
|
# Heat / coolant (0x28-0x2F) -- 1-4 and QWER ARE the coolant system:
|
|
# 1/2/3 Condenser 1-3 valve, 4 coolant FLUSH (hold), Q/W/E Condenser
|
|
# 4-6 valve, R balance coolant. The valve detents run 1-5-50-CLOSED.
|
|
key 1 button 0x2F
|
|
key 2 button 0x2E
|
|
key 3 button 0x2D
|
|
key 4 button 0x2C
|
|
# (yours wins) key Q button 0x2B
|
|
key W button 0x2A
|
|
key E button 0x29
|
|
key R button 0x28
|
|
# Engineering / Mfd2 (0x20-0x27) -- page-gated: Quad page picks an Eng
|
|
# page, Eng page drives generator select A-D / bus mode / coolant.
|
|
key 5 button 0x27
|
|
key 6 button 0x26
|
|
key 7 button 0x25
|
|
key 8 button 0x24
|
|
# (yours wins) key T button 0x23
|
|
key Y button 0x22
|
|
key U button 0x21
|
|
key I button 0x20
|
|
# Comm / target hotbox (0x30-0x37) -- pilot select.
|
|
key 9 button 0x37
|
|
key 0 button 0x36
|
|
key MINUS button 0x35
|
|
key EQUALS button 0x34
|
|
key O button 0x33
|
|
key P button 0x32
|
|
key LBRACKET button 0x31
|
|
key RBRACKET button 0x30
|
|
|
|
# --- LOWER MFD banks: home row on top, the row below beneath -----------
|
|
# G and B are the PANEL GAP between the two lower clusters -- left
|
|
# unbound on purpose, so they keep their 1995 typed meaning.
|
|
# Left Weapons / Mfd1 (0x08-0x0F).
|
|
key A button 0x0F
|
|
key S button 0x0E
|
|
key D button 0x0D
|
|
key F button 0x0C
|
|
key Z button 0x0B
|
|
key X button 0x0A
|
|
key C button 0x09
|
|
key V button 0x08
|
|
# Right Weapons / Mfd3 (0x00-0x07).
|
|
key H button 0x07
|
|
key J button 0x06
|
|
key K button 0x05
|
|
key L button 0x04
|
|
key N button 0x03
|
|
key M button 0x02
|
|
key COMMA button 0x01
|
|
key PERIOD button 0x00
|
|
|
|
# --- the two columns flanking the map, top to bottom -------------------
|
|
# Left (0x10-0x15): map zoom in/out, thermal IR, CROUCH, searchlight,
|
|
# cycle secondary display. Right (0x18-0x1D): cycle control mode
|
|
# (BAS/MID/ADV), unused, Generator A-D on/off.
|
|
key F1 button 0x10
|
|
key F2 button 0x11
|
|
key F3 button 0x12
|
|
key F4 button 0x13
|
|
key F5 button 0x14
|
|
key F6 button 0x15
|
|
key F7 button 0x18
|
|
key F8 button 0x19
|
|
key F9 button 0x1A
|
|
key F10 button 0x1B
|
|
key F11 button 0x1C
|
|
key F12 button 0x1D
|
|
|
|
# --- XInput pad ---
|
|
# POD-FAITHFUL (default): stick X = torso twist, triggers = pedals.
|
|
# TWIN-STICK alternative: replace the LX line with the two below --
|
|
# padaxis LX axis Turn
|
|
# padaxis RX axis JoystickX
|
|
padaxis LX axis JoystickX
|
|
padaxis LY axis JoystickY invert
|
|
padaxis LT axis LeftPedal
|
|
padaxis RT axis RightPedal
|
|
padaxis RY axis Throttle slew 0.7
|
|
pad A button 0x40
|
|
pad B button 0x3F
|
|
pad X button 0x47
|
|
pad Y button 0x42
|
|
pad LB button 0x44
|
|
pad RB button 0x43
|
|
pad DPAD_UP button 0x42
|
|
pad DPAD_DOWN button 0x41
|
|
pad DPAD_LEFT button 0x44
|
|
pad DPAD_RIGHT button 0x43
|
|
|
|
# --- generic joysticks (flight sticks / HOTAS / pedals; DirectInput) ---
|
|
# EASIEST: run the game once with BT_JOYCONFIG=1 (joyconfig.bat) -- an
|
|
# interactive wizard detects your controls and writes this section for you.
|
|
# Manual grammar (rows attach to the last joydev slot; slot 0 if none):
|
|
# joydev <slot 0-3> [product-name substring]
|
|
# joyaxis <X|Y|Z|RX|RY|RZ|SL0|SL1> axis <channel> [invert] [slew <r>] [deadzone <f>]
|
|
# joybutton <0-31> button <addr>
|
|
# joyhat <0-3> <up|down|left|right> button <addr>
|
|
# Typical flight stick (twist = RZ, throttle wheel = SL0):
|
|
# joydev 0
|
|
# joyaxis X axis JoystickX
|
|
# joyaxis Y axis JoystickY invert
|
|
# joyaxis RZ axis Turn
|
|
# joyaxis SL0 axis Throttle invert deadzone 0
|
|
# joybutton 0 button 0x40
|
|
# joybutton 1 button 0x46
|
|
# joyhat 0 up button 0x42
|
|
# joyhat 0 down button 0x41
|
|
# joyhat 0 left button 0x44
|
|
# joyhat 0 right button 0x43
|
|
|
|
# --- carried over from your previous bindings.txt (these beat the defaults above) ---
|
|
key T button 0x2B # my custom: T = eng page thing I like
|
|
key Q axis Throttle slew + 0.9
|
|
|
|
# >>> BT_JOYCONFIG generated -- do not edit between markers
|
|
joyaxis 0 X axis JoystickX
|
|
joybutton 0 1 button 0x40
|
|
# <<< BT_JOYCONFIG end
|