-
Notifications
You must be signed in to change notification settings - Fork 0
Client Input Hotkey Handler
Source-verified 2026-06-21 against master 0139a346. Paths relative to Missions/[55-2hc]warfarev2_073v48co.chernarus/ unless noted. Arma 2 OA 1.64.
The client input layer is a single block in Client/Init/Init_Client.sqf that grabs the main mission display (findDisplay 46) and stacks several independent KeyDown/KeyUp event handlers onto it, plus a separate per-player hotkey script (Client/Init/Init_Keybind.sqf) called later in the same boot. Each handler reads the engine-supplied keycode from _this select 1 and either compares it against an engine action-key binding (actionKeys "User##" / actionKeys "VehLockTargets" / move keys) or against a raw DirectInput (DIK) scancode. Because Arma stacks display handlers rather than replacing them, every handler in the block fires on every key press; the order below is registration order.
This page documents the registration block and the handler scripts it installs. The User18/User19/User20 view-distance handler is registered in the very same block (Init_Client.sqf:272,276) but is fully documented on its own page — see View Distance And Target FPS Auto Throttle. The User11 skin-selector hotkey from Init_Keybind.sqf is documented on Skin Selector And Class Swap Reference. Both are cross-linked here, not re-documented.
Three handler bodies are compiled into global names first, then attached to _display = findDisplay 46 (Init_Client.sqf:273):
| Step | Line | What it does |
|---|---|---|
Compile keyPressed
|
Init_Client.sqf:243 |
compile preprocessFile "Common\Functions\Common_DisableTablock.sqf" |
Compile keyPressedForAutoSendSpawnedUnitsToWaypoint
|
Init_Client.sqf:271 |
compile preprocessFile "Common\Functions\Common_AutoSendSpawnedUnitsToWaypoint.sqf" |
Compile keyPressedForAdjustingViewDistance
|
Init_Client.sqf:272 |
view-distance handler — see View Distance And Target FPS Auto Throttle |
Attach tab-lock KeyDown
|
Init_Client.sqf:274 |
_this call keyPressed |
Attach auto-send KeyDown
|
Init_Client.sqf:275 |
_this call keyPressedForAutoSendSpawnedUnitsToWaypoint |
Attach view-distance KeyDown
|
Init_Client.sqf:276 |
_this call keyPressedForAdjustingViewDistance |
Attach debug-teleport KeyDown (inline) |
Init_Client.sqf:278 |
DIK 26 arms teleport under WF_Debug
|
Attach map-disband Ctrl KeyDown (inline) |
Init_Client.sqf:280 |
DIK 29/157 set Ctrl-down flag true |
Attach map-disband Ctrl KeyUp (inline) |
Init_Client.sqf:281 |
DIK 29/157 clear Ctrl-down flag |
Attach tab-lock KeyDown (again) |
Init_Client.sqf:290,292 |
WFBE_CO_FNC_DisableTabLock = same Common_DisableTablock.sqf re-compiled and re-attached |
Attach AFK move-key KeyDown
|
Init_Client.sqf:267,277 |
WFBE_CO_FNC_HandleAFKkeys = Client\Module\AFKkick\handleKeys.sqf
|
After the AFK handler, the block kicks off the AFK monitor loop with [] execVM "Client\Module\AFKkick\monitorAFK.sqf" (Init_Client.sqf:306). The map-click consumer WFBE_CL_FNC_HandleMapSingleClick is wired separately at Init_Client.sqf:282 via onMapSingleClick (not a display handler), and it reads the two state flags the inline handlers maintain.
Note that Common_DisableTablock.sqf is compiled and attached twice — once as keyPressed (:270, :274) and again as WFBE_CO_FNC_DisableTabLock (:290, :292) — so the tab-lock suppression runs on two stacked handlers. Both bodies are identical (the second uses preprocessFileLineNumbers); neither short-circuits the other because each returns its own _handled value.
| Handler | Bound key / DIK | Action key name | Effect | Source |
|---|---|---|---|---|
| Tab-lock disable |
VehLockTargets (default Tab) |
actionKeys "VehLockTargets" |
Returns true (swallows the key, blocking lock-on) for ground vehicles except a whitelist; returns false (lock allowed) on foot, in Air, and for listed AA platforms |
Common_DisableTablock.sqf:14,18-38 |
| Auto-send spawned units toggle | User13 |
actionKeys "User13" |
Toggles AUTO_SEND_SPAWNED_UNITS_TO_WAYPOINT, prints a group-chat line, plays a toggle sound; always returns false
|
Common_AutoSendSpawnedUnitsToWaypoint.sqf:10-22 |
| View distance / target FPS |
User18 / User19 / User20
|
actionKeys "User18/19/20" |
Auto-mode toggle and FPS/view-distance stepping — see dedicated page |
Common_AdjustViewDistance.sqf (see View Distance And Target FPS Auto Throttle) |
| Debug teleport arm | DIK 26 (the [ key) |
raw scancode | Only when WF_Debug: sets WFBE_DEBUG_TELEPORT_ARMED = true, hints "Debug teleport ARMED", returns true; otherwise false
|
Init_Client.sqf:278 |
| Map-disband Ctrl track (down) | DIK 29 / 157 (Left/Right Ctrl) |
raw scancode | Sets WFBE_CLIENT_MAP_DISBAND_CTRL_DOWN = true; returns false
|
Init_Client.sqf:280 |
| Map-disband Ctrl track (up) | DIK 29 / 157 (Left/Right Ctrl) |
raw scancode (KeyUp) | Sets WFBE_CLIENT_MAP_DISBAND_CTRL_DOWN = false; returns false
|
Init_Client.sqf:281 |
| AFK move-key reset | Move/map keys | actionKeys "MoveBack" + ... + "showMap" |
Sets WFBE_CO_VAR_NotAFK_update = true so the AFK monitor resets its timer; returns false
|
handleKeys.sqf:11-16 |
| Skin selector open | User11 |
actionKeys "User11" |
Opens the skin selector — bound on player, not display 46; see dedicated page |
Init_Keybind.sqf:6-12 (see Skin Selector And Class Swap Reference) |
A handler that returns true reports the key as handled and suppresses the engine's default for that frame; the WASP handlers that return false (auto-send, map-disband tracking, AFK) are passive observers that never eat the key. The DIK codes are raw because the affected keys ([, Ctrl) are not exposed through onMapSingleClick, which only surfaces Shift and Alt.
Reads _key (:12) and the player's lock-target binding _tabbuttons = actionKeys "VehLockTargets" (:14). It allows tab-lock (_handled = false) when the player is on foot (_vehicle == player, also covers using a bipod), in any Air vehicle, or in one of the listed AA platforms while that platform's AA weapon is selected: M6_EP1/2S6M_Tunguska with 9M311Laucher, HMMWV_Avenger/HMMWV_Avenger_DES_EP1 with StingerLaucher, and ZSU_INS/ZSU_CDF/ZSU_TK_EP1 with AZP85 (:18-26). For any other vehicle, pressing a lock key sets _handled = true (:33-37), which suppresses lock-on. Returns _handled (:40). The file's TODO notes man-portable Stinger/Igla and BRDM AA are not yet covered (:5).
On User13 (:10) it flips AUTO_SEND_SPAWNED_UNITS_TO_WAYPOINT (:11-19), announces the new state through GroupChatMessage, and plays autoViewDistanceToggledOff/autoViewDistanceToggledOn (:14,18) — it reuses the view-distance toggle sounds. The flag is initialized to false at Init_Client.sqf:186 and is read by the spawned-unit waypoint logic at Client/Functions/Client_SetAttackWaveDetails.sqf:13 and Client/Functions/Client_SendSpawnedUnitsToLeaderWaypoint.sqf:13. Always returns false (:22).
These two are inline handler strings, not separate files. The debug-teleport handler (Init_Client.sqf:278) is gated on WF_Debug; pressing [ (DIK 26) arms a one-shot WFBE_DEBUG_TELEPORT_ARMED. The next plain (non-Shift) map click consumes and disarms it in Client/Functions/Client_HandleMapSingleClick.sqf:175,179. The inline comment (:277) records the prior behavior — every map click teleported while WF_Debug was on, which ate the sell/ICBM confirm clicks — so arming was added to make it deliberate. The Ctrl-tracking pair (:280-281) maintains WFBE_CLIENT_MAP_DISBAND_CTRL_DOWN because onMapSingleClick does not expose the Ctrl modifier; the flag is read by the disband path in Client_HandleMapSingleClick.sqf:17.
WFBE_CO_FNC_HandleAFKkeys builds _moveButtons from the union of actionKeys for MoveBack, MoveDown, MoveForward, MoveFastForward, MoveLeft, MoveRight, HideMap and showMap (:11). If the pressed key is in that set it sets WFBE_CO_VAR_NotAFK_update = true (:14) and returns false (passive). The companion loop monitorAFK.sqf polls that flag once per cycle: on true it resets _timer to 0 and clears the flag (:12-14); otherwise it increments, warns once past WFBE_CO_VAR_AFKkickThreshold / 1.5 (:19-22), and self-kicks via publicVariableServer "AFKthresholdExceededName" + failMission "END1" when _timer exceeds WFBE_CO_VAR_AFKkickThreshold (:24-27). The loop condition is while {!gameOver} (the A2 OA built-in), not WFBE_GameOver. The threshold is set to 30 at Init_Client.sqf:297.
Init_Keybind.sqf is called by [] Call Compile preprocessFile "Client\Init\Init_Keybind.sqf" at Init_Client.sqf:607. It defines two function globals and attaches one of them to player (not display 46):
| Item | Source | Status |
|---|---|---|
WF_SkinSelector_Hotkey |
Init_Keybind.sqf:2-13 |
Registered via player addEventHandler ["KeyDown", WF_SkinSelector_Hotkey] (:14). On User11, opens WASP\actions\SkinSelector\SkinSelector_Open.sqf only when WFBE_C_SKIN_SELECTOR == 1, the player is alive, on foot, and no dialog is open (:6-11). |
WF_Gear_Hotkeys |
Init_Keybind.sqf:17-40 |
Defined but never registered. No addEventHandler references WF_Gear_Hotkeys anywhere in the mission, so these bindings never fire. |
WF_Gear_Hotkeys was intended to set the gear-filler mode by writing WF_Logic setVariable ['filler', ...]: User15 = all, User16 = template, User17 = primary, User18 = secondary, User19 = sidearm, User20 = misc (Init_Keybind.sqf:22-39). Because the closing brace at Init_Keybind.sqf:40 ends the file without an addEventHandler call, this is dead code in the current master. Note the overlap: User18/User19/User20 are live on display 46 for view distance (Init_Client.sqf:276), so even if the gear function were registered, those three action keys would drive both systems at once.
Home | Agent Guide | Current live state | Release 1.2.2 (B91) | Quickstart | Progress | Lifecycle wait-chain | Join/disconnect | Parameters/build | Assets/config | SQF atlas | PV index | Modules | Support/specials | Commander/HQ | Commander vote/reassign | Construction/CoIn | Construction cleanup | WDDM compositions | Factory/purchase | Upgrades/research | Towns/camps/capture | Victory/endgame | Markers/cleanup | Server runtime | AI runtime/HC | AI commander audit | HC delegation | Town AI safety | Commander reassignment | Resistance supply | Player UI workflow | UI atlas | Respawn/death | Gear template filter | Vehicle cargo loop | Service guards | UI IDD repair | UI design inspiration | WASP overlay | Feature status | Source propagation | release readiness | Tooling readiness | Integration trust | AntiStack DB | Owner decisions | Shelved registry | Abandoned feature revival | Hardening roadmap | PVF dispatch | Server authority | ICBM authority | Attack-wave authority | Telemetry families | AICOM V2 cutover | Consumer port map | Testing workflow | Server ops | Web tools | Ecosystem repos | Arma 2 OA refs | A2 traps | OA compatibility audit | Coverage ledger | Navigation inventory | Pruning ledger | Knowledge roadmap | Agent context | Collab protocol | Worklog | Audit archive 2026-07 | Briefing reference | Utes invasion concept
- Shelved AICOM concepts - revivable someday ideas (owner-shelved 2026-07-03)
Docs rule: source-backed claims only; Arma 2 OA scripting docs only; gameplay edits start in Missions/[55-2hc]warfarev2_073v48co.chernarus.
- Getting started
- Status and coordination
- Agent context
- Agent collaboration protocol
- Agent worklog
- Agent worklog archive
- Progress dashboard
- PR cleanup and integration lab
- Shelved PR #169: gear price double-count
- Shelved PR #194: Chernarus no-trees
- Coordination board
- Codebase coverage ledger
- Bottleneck removal queue
- Current source status
- Wiki mirror reconciliation
- Navigation inventory
- Registers
- Agent orchestration
- Architecture
- Architecture overview
- Mission entrypoints and lifecycle
- Lifecycle wait chain
- Player join/disconnect and AntiStack lifecycle
- Mission parameters/localization/build inputs
- Stringtable localization key-family catalog
- Source inventory
- Content structure and maps
- Assets/config/localization/parameters
- Mission start parameters index
- Code and networking
- Gameplay systems
- Core systems index
- Gameplay systems atlas
- Commander/HQ lifecycle atlas
- Economy, towns and supply
- Economy system reference
- Balance asymmetries
- Anti-stack skill-balance mechanic
- Empty-side supply income stagnation
- Towns, camps and capture atlas
- Victory and endgame atlas
- Victory conditions reference
- Territorial victory reference
- Marker cleanup and restoration
- Marker loop engine and registries
- Map marker families content catalog
- Marker subsystem function reference
- Client marker FSM updater map
- Support specials and tactical modules
- SCUD TEL tactical munitions
- Naval HVT objectives (carriers/SCUD)
- SCUD saturation strike mechanic
- Takistan airfield FPV drone design
- Construction and CoIn systems
- Structure damage reduction & friendly-fire
- Construction logic list cleanup
- Flak tower & WDDM anchor compositions
- Resistance supply scaffold
- GUER Insurgents faction overview
- GUER Insurgents branch audit
- GUER insurgent player economy
- GUER air-defense loop (Ka-137/Mi-24)
- Upgrades and research atlas
- Supply mission architecture
- Supply mission authority cleanup
- Current supply helicopters PR1
- Respawn and death-loop lifecycle
- Vehicle theft economy pitch
- GUER tunnel network pitch
- Content, reference and catalogs
- Faction unit/vehicle roster catalog
- Auxiliary/SF/civilian unit catalog
- Gear store loadout route catalog
- Upgrade research (cross-faction)
- Gear store price and upgrade catalog
- Gear store catalog (complete, per faction)
- Defense structures catalog
- Artillery reference per faction
- AI squad team templates catalog
- Town AI lifecycle reference
- Town AI group composition catalog
- Class-skill system reference
- Player skill abilities reference
- Default gear template content catalog
- Chernarus map content reference
- Takistan map content reference
- Takistan features
- Takistan parity reference
- Takistan oilfields objective reference
- IRS IR-smoke countermeasure
- Arty module special munitions
- Zeta cargo sling-load reference
- Spawn primitive function reference
- Kill and score pipeline
- Waypoint helper function reference
- Position and proximity function reference
- Side/team state function reference
- Player AI watchdog and recovery
- AICOM stuck-recovery v2
- LoadoutManager data-model contributor guide
- Discord status bot setup and reference
- GLOBALGAMESTATS extension reference
- New player quickstart (player guide)
- Optional client mods (player guide)
- Earning funds and score (player guide)
- Vehicle service and logistics (player guide)
- Commander's handbook (player guide)
- Tactical support menu
- Paradrop player experience
- Supply missions (player guide)
- In-game briefing & Diary field manual
- Playable maps catalog
- Faction root variables reference
- Faction base structures catalog
- Counter-battery radar system
- Bank, Reserve and Artillery Radar structures
- Map ruleset model and object config
- Countermeasures module reference
- Vehicle countermeasure (flares/spoofing)
- UAV terminal and spotter system
- Artillery firing function reference
- Service Point pricing model
- Medic redeployment truck (forward spawn)
- Side-patrol runtime and convoy mechanics
- Day/night cycle and weather system
- Config lookup helper reference
- CIPHER sort utilities reference
- Modded maps status and content
- BattlEye filter setup and OA taxonomy
- Player squad/group join protocol
- AutoFlip vehicle recovery
- Engine stealth fuel toggle
- Valhalla vehicle climbing-assist
- Missile and ordnance Fired-EH reference
- Vehicle equip and rearm reference
- Array and collection utilities
- Server composition spawner reference
- Upgrade queue server loop
- Map boundaries and off-map enforcement
- Namespace/profile/diagnostic utilities
- Group bool getVariable A2-OA trap
- Vehicle weapon balance init
- View distance auto-throttle
- Camp & respawn-camp getters
- Performance audit writer
- Site clearance (bulldozer)
- Factory queue cancel & refund
- AI commander tunable constants
- Experimental feature-flag constants
- Flag system quick reference
- Mission tunable constants catalog
- Gear parsing & cargo capacity
- Structure dressing function
- Paradrop delivery functions
- ICBM nuke client VFX & radiation
- Server HandleSpecial router
- LocalizeMessage chat router
- Gear buy-menu render & price functions
- Server broadcast & telemetry loops
- Per-unit client init pipeline
- Vehicle marking & texture pipeline
- Defense category & budget
- Legacy AI order primitives
- Commander-team driver
- AICOM command verbs
- AICOM behavior fix taxonomy
- AI commander wildcard deck reference
- AICOM aircraft and airfield system
- Static-defense manning
- End-of-game stats screen
- AI commander execution loop
- Deployable bipod / weapon resting
- Town-economy getters
- Server-init deadspawn & airfield probe
- GUER VBIED detonate action
- Resource income-tick engine
- AI commander treasury accessors
- PVF send-helper contracts
- AICOM logging & AICOMSTAT telemetry
- AICOMSTAT v2 event census
- WASPSCALE v2 telemetry
- WASPSCALE v2-ext coverage audit
- Telemetry families reference
- Group lifecycle & entity reaping
- Batch AI spawner orchestrator
- Client funds/income HUD readout
- Server group GC & cap warning
- Town runtime tuning constants
- Client input/hotkey handler
- WASP base-repair system
- WASP DropRPG launcher/ordnance
- CoIn construction-interface client engine
- Town-capture garrison & airfield rebuild
- Map-control & minimap templates
- Client FPS & state telemetry
- Client service-proximity getters
- Airfield-exclusive roster & unit hints
- Unit-camera spectator system
- Town-garrison patrol/defense worker
- RequestTeamUpdate squad-discipline
- Arma2Warfare GPT assistant
- LoadoutManager build configs & defines
- GLOBALGAMESTATS extension logging
- Discord bot instrumented logging
- Eden/Everon & Taviana map content
- Cruise missile strike asset
- AI / HC
- AI headless and performance
- AI mods and pathfinding reference
- Headless client scaling and topology
- AI runtime/HC loop map
- Headless client init and stat loop
- HC delegation target selection
- Player AI caps and role balance
- Old WarfareBE FPS comparison
- AI commander autonomy audit
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- AI commander capture & fun plan
- AI commander B69 improvement roadmap
- AI commander B69 implementation sketches
- AICOM V2 cutover status
- Headless delegation and failover
- Commander reassignment call shape
- GUER Director living-resistance pitch
- Quality and operations
- Foundation perf findings & Tier-3 dead-ends
- Dead/stale code register
- Commander vote/reassignment
- Attack-wave authority
- Server runtime and operations
- Server ops runbook
- JIP enrollment & client data delivery (b74.2 lessons)
- Server gameplay runtime atlas
- PerformanceAuditAnalyzer
- Performance opportunity sweep
- Documentation plan
- Knowledge platform roadmap
- Wiki quality audit
- Wiki pruning and relevance ledger
- Audit findings queue (2026-06-03)
- Deep review findings
- Client UI / server-loop perf findings
- Performance gain simulation
- Self-host testing field notes
- Cleanup and work lanes
- Hardening and authority
- UI / player workflows
- Client UI, HUD and menus
- UI HUD and dialogs
- Player UI workflow map
- Client UI systems atlas
- UI IDD collision repair
- UI control class library reference
- UI theme palette and style macros
- UI design inspiration 2026-07
- Available-actions client gate FSM
- Gear/loadout/EASA atlas
- Gear template profile filter
- Vehicle cargo equip loop bounds
- Factory and purchase systems atlas
- Service menu affordability guards
- WASP overlay
- Class-skill system reference
- Skin selector and class swap
- Earplugs audio toggle
- Mission audio catalog
- HQ radio knowledge-base catalog
- QoL trio player hints
- Player vehicle/travel actions
- Tooling / release / integrations
- Tools and build workflow
- Warfare web tools
- Ecosystem & companion repos
- Zargabad tooling parity
- July 2026 release readiness
- Operator monitor and CPU affinity tools
- Tooling release readiness audit
- Source fix propagation queue
- Agent release readiness ledger
- Release source intake map
- Testing/debugging/release workflow
- Current RPT release gate
- RPT telemetry consumer port map
- External integrations
- Integration trust boundary audit
- AntiStack database extension audit
- Community & Dev
- Community & Dev
- Miksuu upstream wiki import / archive index
- Upstream changelog feature leads
- Developer history and upstream lessons
- Upstream Miksuu commit intel
- Upstream mining ledger
- Archive script mining v2
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- PR8 and Drone upstream lesson match
- Development lessons learned
- External research reports
- Audit archive 2026-07
- Briefing reference
- Utes invasion concept
- Miksuu archive: Home
- Miksuu archive: Welcome
- Miksuu archive: Big announcements
- Miksuu archive: Changelog
- Miksuu archive: Development process
- Miksuu archive: Discord bot
- Miksuu archive: Gameplay videos
- Miksuu archive: LoadoutManager
- Miksuu archive: Chernarus script architecture
- Base-game visual catalogs
- Compatibility and references
- HC upstream history and lessons
- Player stats branch audit
- BuyMenu EASA QoL branch audit
- Perf quick wins branch audit
- Commander positions branch audit
- Zargabad branch audit
- Quad AI Commander concept
- Arma 2 OA external reference guide
- Base-game config & image reference
- Arma 2 OA compatibility audit
- Arma 2 OA agent traps reference
- Arma 2 OA command versions
- Wiki source consistency
- External Arma 2 OA reference index