Input remap: CONTROLS.MAP binding engine + XInput gamepad support
The pod's controls reach the game through the RIO serial board; on a
desktop that hardware is a keyboard shim of hardcoded GetAsyncKeyState
reads. New binding engine (game/reconstructed/btinput.cpp) maps PC keys
and an XInput pad onto the authentic channels through a user-editable
file (content/CONTROLS.MAP, community-suggested grammar, corrected):
key/pad -> button <addr> real buttonGroup emissions, mirroring the
RIO convention exactly (press a+1 w/ mode
mask saved, release -a-1 w/ saved mask;
L4CTRL.cpp:2470-2520) -- aux/preset banks,
hotbox, panic, reverse thrust all reachable
key/pad -> axis Throttle rate (lever), pedals/JoystickX
deflect (turn/twist) into the existing
virtual-controls integrators (feel, gait
detent, spring-centering all unchanged)
keypad pilot|external <n> keyboardGroup key values ('0'-'F')
pckey <char> any authentic 1995 typed hotkey
action <name> port dev controls (view, all-stop, ...)
Keys claimed by a binding are SUPPRESSED from the legacy WM_CHAR/KEYUP
feed -- ends the historic double-dispatch ('w' drove AND selected pilot
0; F5's key-up value 0x74 aliased to the 't' hotkey; letter key-ups fed
the developer fake-event dispatcher). Unbound keys keep their authentic
meaning. The dual-use 'V' is split: V = view toggle, B = look behind.
Default profile = WASD classic (compiled-in twin; delete the file to
restore). CONTROLS_NUMPAD.MAP ships the corrected community layout
(keypads are NOT buttons 0x50-0x6F -- that space doesn't exist; no
clickable cockpit exists so everything needs a binding; keyboard fire
buttons added; 0x36/0x37 are hotbox not 'config'; missiles moved off
Ctrl). XInput loads dynamically (1_4 -> 9_1_0), disconnected-pad
probing rate-limited; pad sticks write the axes as absolute positions
(the spring is physical), triggers/buttons per the file.
Verified live: bindings load (43), W and NumPad8 drive (speedDemand 0 ->
61.5), X all-stop (spd -> 0), aux-bank emission (D1 -> [input] 0x2f
PRESS/release under the numpad profile), suppression both directions
(posted 'r' reaches [keych], posted 'w' swallowed), full-keyspace
WM_CHAR+WM_KEYUP fuzz x3 survived with sim advancing, XInput graceful
with no pad, 2-node relay session un-regressed (full ladder + UDP).
Pad-in-hand testing still needs a physical controller.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
0fcd0c3106
commit
980c9cd7e5
@@ -0,0 +1,100 @@
|
||||
# ==========================================================================
|
||||
# BT411 CONTROLS.MAP -- desktop input bindings (keyboard + XInput gamepad)
|
||||
# ==========================================================================
|
||||
# One binding per line, '#' starts a comment, keywords are case-insensitive.
|
||||
# Loaded at game start; DELETE THIS FILE to restore these exact defaults
|
||||
# (the same profile is compiled in). Alternate profile: CONTROLS_NUMPAD.MAP
|
||||
# (copy it over this file to use it).
|
||||
#
|
||||
# key <name> button <addr> [toggle]
|
||||
# key <name> axis <axis> deflect <n>
|
||||
# key <name> axis <axis> rate <n-per-second>
|
||||
# key <name> keypad pilot|external <0-15>
|
||||
# key <name> pckey <char>
|
||||
# key <name> action <name>
|
||||
# pad <button> button <addr> | action <name> | pckey <char> | keypad ...
|
||||
# padaxis <src> axis <axis> [invert] [deadzone <d>] [rate <n-per-second>]
|
||||
#
|
||||
# <addr> RIO button address 0x00-0x47 (hex or decimal):
|
||||
# 0x00-0x0F aux lower right/left banks 0x10-0x1B secondary panel
|
||||
# 0x20-0x37 aux upper center/left/right (presets + target hotbox)
|
||||
# 0x3D Panic 0x3F throttle-head (REVERSE THRUST)
|
||||
# 0x40 Main trigger 0x41-0x44 hat 0x45 Pinky 0x46 Middle 0x47 Upper
|
||||
# <axis> Throttle | LeftPedal | RightPedal | Pedals (signed, + = right)
|
||||
# | JoystickX (torso twist) | JoystickY
|
||||
# <name> A-Z, D0-D9 (digit row), F1-F12, NumPad0-NumPad9, Up, Down, Left,
|
||||
# Right, Space, Enter, Shift, Ctrl, Alt, PageUp, PageDown, Home,
|
||||
# End, Insert, Delete, OemMinus, Oemplus, Oemcomma, OemPeriod,
|
||||
# OemOpenBrackets, OemCloseBrackets, ...
|
||||
# <button> A B X Y DPadUp DPadDown DPadLeft DPadRight Start Back
|
||||
# LeftShoulder RightShoulder LeftThumb RightThumb
|
||||
# LeftTrigger RightTrigger (as digital, >= 50% pressed)
|
||||
# <src> LeftStickX LeftStickY RightStickX RightStickY
|
||||
# LeftTrigger RightTrigger
|
||||
# action ViewToggle LookBehind AllStop ModeCycle Valve ConfigHold
|
||||
# Generator1-4 Reconnect
|
||||
# pckey sends an authentic 1995 PC-keyboard hotkey (the in-cockpit
|
||||
# dispatcher): '+'/'-' = target zoom, 'w'..'o' = pilot select,
|
||||
# 'a','b','c','d','f','g','s','v','x','z' = display presets, ...
|
||||
#
|
||||
# 'deflect' holds the axis there while the key is down and springs back on
|
||||
# release; 'rate' walks the axis by <n> per second and the position sticks
|
||||
# (the throttle lever). A key bound here is REMOVED from the legacy typed-
|
||||
# hotkey channel (no double dispatch); unbound keys keep their authentic
|
||||
# 1995 meaning (see pckey above).
|
||||
#
|
||||
# ---- WASD CLASSIC (the shipped default) ----------------------------------
|
||||
|
||||
# Driving: W/S sweep the throttle lever (sticks, detent at zero); A/D are
|
||||
# the turn pedals (spring back); Q/E twist the torso; X = all stop.
|
||||
key W axis Throttle rate 0.7
|
||||
key S axis Throttle rate -0.7
|
||||
key Up axis Throttle rate 0.7
|
||||
key Down axis Throttle rate -0.7
|
||||
key A axis LeftPedal deflect 1
|
||||
key D axis RightPedal deflect 1
|
||||
key Left axis LeftPedal deflect 1
|
||||
key Right axis RightPedal deflect 1
|
||||
key Q axis JoystickX deflect -1
|
||||
key E axis JoystickX deflect 1
|
||||
key X action AllStop
|
||||
|
||||
# Fire: the pod joystick's four buttons.
|
||||
key D1 button 0x40 # Main trigger (lasers group)
|
||||
key Space button 0x40
|
||||
key D2 button 0x46 # Middle thumb (PPCs group)
|
||||
key D3 button 0x47 # Upper thumb (missiles group)
|
||||
key Ctrl button 0x47
|
||||
key D4 button 0x45 # Pinky (4th group)
|
||||
|
||||
# Systems.
|
||||
key G action ConfigHold # hold + fire keys = regroup the weapon
|
||||
key C action Valve # coolant valve cycle
|
||||
key M action ModeCycle # Basic -> Standard -> Veteran controls
|
||||
key V action ViewToggle # cockpit <-> chase camera (dev)
|
||||
key B action LookBehind # HOLD = the pod's rear-view button
|
||||
key F5 action Generator1
|
||||
key F6 action Generator2
|
||||
key F7 action Generator3
|
||||
key F8 action Generator4
|
||||
key F9 action Reconnect
|
||||
|
||||
# ---- Xbox controller -----------------------------------------------------
|
||||
# Left stick steers (the pedals), right stick twists the torso and pushes
|
||||
# the throttle lever; triggers fire.
|
||||
padaxis LeftStickX axis Pedals deadzone 0.24
|
||||
padaxis RightStickX axis JoystickX deadzone 0.24
|
||||
padaxis RightStickY axis Throttle rate 0.75 deadzone 0.24
|
||||
pad RightTrigger button 0x40 # Main
|
||||
pad LeftTrigger button 0x47 # Upper (missiles)
|
||||
pad RightShoulder button 0x46 # Middle (PPCs)
|
||||
pad LeftShoulder button 0x45 # Pinky
|
||||
pad DPadUp button 0x42 # hat up
|
||||
pad DPadDown button 0x41 # hat back
|
||||
pad DPadLeft button 0x44 # hat left
|
||||
pad DPadRight button 0x43 # hat right
|
||||
pad B action AllStop
|
||||
pad Y action ViewToggle
|
||||
pad X action LookBehind
|
||||
pad Start action ModeCycle
|
||||
pad Back action Valve
|
||||
@@ -0,0 +1,99 @@
|
||||
# ==========================================================================
|
||||
# BT411 CONTROLS_NUMPAD.MAP -- the community-suggested numpad layout
|
||||
# (corrected). To use it: copy this file over CONTROLS.MAP.
|
||||
# Grammar + address reference: see CONTROLS.MAP.
|
||||
# ==========================================================================
|
||||
# Corrections vs. the original suggestion:
|
||||
# - keypads are NOT button addresses 0x50-0x6F (that space doesn't exist);
|
||||
# use `keypad pilot|external <0-15>` when those panels get mapped
|
||||
# - there is no clickable on-screen cockpit -- every function you want
|
||||
# must be bound here
|
||||
# - keyboard fire buttons added (the suggestion only had Main; Pinky/
|
||||
# Middle/Upper were pad-only, stranding weapons regrouped onto them)
|
||||
# - Ctrl throttle-down kept, but missiles moved off Ctrl to NumPad3
|
||||
# - 0x36/0x37 are target-hotbox buttons (pilot select), not "config 1/2"
|
||||
# - port actions (view, all-stop, mode cycle, valve, generators) bound
|
||||
#
|
||||
# ---- Driving: number pad ------------------------------------------------
|
||||
key NumPad8 axis Throttle rate 0.75 # lever up
|
||||
key NumPad2 axis Throttle rate -0.75 # lever down
|
||||
key NumPad4 axis LeftPedal deflect 1 # turn left
|
||||
key NumPad6 axis RightPedal deflect 1 # turn right
|
||||
key NumPad7 axis JoystickX deflect -1 # torso twist left
|
||||
key NumPad9 axis JoystickX deflect 1 # torso twist right
|
||||
key NumPad5 action AllStop
|
||||
key Shift axis Throttle rate 0.75 # throttle up (alt)
|
||||
key Ctrl axis Throttle rate -0.75 # throttle down (alt)
|
||||
key Alt button 0x3F # throttle-head = REVERSE THRUST
|
||||
|
||||
# ---- Fire: numpad cluster + space ---------------------------------------
|
||||
key Space button 0x40 # Main trigger
|
||||
key NumPad0 button 0x40
|
||||
key NumPad1 button 0x45 # Pinky
|
||||
key NumPad3 button 0x47 # Upper (missiles)
|
||||
key Decimal button 0x46 # Middle (PPCs)
|
||||
|
||||
# ---- Joystick hat on the arrows -----------------------------------------
|
||||
key Up button 0x42 # Hat Up
|
||||
key Down button 0x41 # Hat Back
|
||||
key Left button 0x44 # Hat Left
|
||||
key Right button 0x43 # Hat Right
|
||||
|
||||
# ---- Systems ------------------------------------------------------------
|
||||
key G action ConfigHold
|
||||
key Enter action ModeCycle
|
||||
key V action ViewToggle
|
||||
key B action LookBehind
|
||||
key F5 action Generator1
|
||||
key F6 action Generator2
|
||||
key F7 action Generator3
|
||||
key F8 action Generator4
|
||||
key F9 action Reconnect
|
||||
key F10 action Valve
|
||||
|
||||
# ---- Upper MFD banks: number row = the top aux row, QWERTY row = the row
|
||||
# ---- under it, left to right across the Left / Center / Right panels.
|
||||
# ---- (These buttons drive the preset/eng-data selection; the letters
|
||||
# ---- lose their 1995 typed-hotkey meaning once bound here.)
|
||||
key D1 button 0x2F
|
||||
key D2 button 0x2E
|
||||
key D3 button 0x2D
|
||||
key D4 button 0x2C
|
||||
key D5 button 0x27
|
||||
key D6 button 0x26
|
||||
key D7 button 0x25
|
||||
key D8 button 0x24
|
||||
key D9 button 0x37 # hotbox (target select)
|
||||
key D0 button 0x36 # hotbox
|
||||
key OemMinus button 0x35 # hotbox
|
||||
key Oemplus button 0x34 # hotbox
|
||||
key Q button 0x2B
|
||||
key W button 0x2A
|
||||
key E button 0x29
|
||||
key R button 0x28
|
||||
key T button 0x23
|
||||
key Y button 0x22
|
||||
key U button 0x21
|
||||
key I button 0x20
|
||||
key O button 0x33 # hotbox
|
||||
key P button 0x32 # hotbox
|
||||
key OemOpenBrackets button 0x31 # hotbox
|
||||
key OemCloseBrackets button 0x30 # hotbox
|
||||
|
||||
# ---- Xbox controller (same as the default profile) ----------------------
|
||||
padaxis LeftStickX axis Pedals deadzone 0.24
|
||||
padaxis RightStickX axis JoystickX deadzone 0.24
|
||||
padaxis RightStickY axis Throttle rate 0.75 deadzone 0.24
|
||||
pad RightTrigger button 0x40
|
||||
pad LeftTrigger button 0x47
|
||||
pad RightShoulder button 0x46
|
||||
pad LeftShoulder button 0x45
|
||||
pad DPadUp button 0x42
|
||||
pad DPadDown button 0x41
|
||||
pad DPadLeft button 0x44
|
||||
pad DPadRight button 0x43
|
||||
pad B action AllStop
|
||||
pad Y action ViewToggle
|
||||
pad X action LookBehind
|
||||
pad Start action ModeCycle
|
||||
pad Back action Valve
|
||||
Reference in New Issue
Block a user