Binds & Console

KF2 Immersive Mode: Hide the HUD with an AutoHotkey Script

Some players like to run Killing Floor 2 with no heads-up display for a more immersive feel, but still want to glance at health, ammo, syringe status, ZEDs left, trader distance, teammate positions, chat and similar details now and then. This guide shares a short AutoHotkey script that hides the HUD and shows it only while you hold a key.

Prerequisites

  • The H key bound to the console command showhud in your input.ini: Bindings=(Name="h",Command="showhud")
  • TAB bound to the scoreboard
  • The middle mouse button bound to the radio commands wheel
  • AutoHotkey installed (a widely used scripting tool, not a shady one)

How to use

  1. Start the script.
  2. Join a game.
  3. Press H to hide the HUD. You need to do it at the start of every wave, because the trader brings the HUD back.
  4. While playing, hold TAB or the middle mouse button to see the HUD.
  5. If you play Medic or just want to stop, press F12 to toggle the script off and H to bring the HUD back.

Notes from the author:

  • It only applies while the KF2 window is focused.
  • It supports alt-tabbing in and out, and going in and out of the Steam overlay.
  • The author is not an AutoHotkey expert, so the code may not be optimal, but it works well.
  • You can use another key instead of H, but a letter key will cause trouble in chat because it sends the h command twice every time you type it.

The script

Copy the following into a Notepad file and save it with the extension .ahk. With AutoHotkey installed, double-click it to start; a green H appears in the tray.

global hf:=false
_ht(){
 hf:=!hf
 send h
}
#ifwinactive ahk_exe KFGame.exe
f12::suspend
~*mbutton::
~tab::
 if !hf ? _ht() : return
~*mbutton up::
~tab up::
 if hf ? _ht() : return

The idea: when TAB or the middle mouse button goes down, the script toggles the HUD on if it is currently hidden, and when the button is released it toggles it off again. It sends the H key, which your bind turns into showhud.

Comments

Some readers dismissed it as just a showhud bind. The author replied that this is not the case, since a plain bind on TAB would blink the HUD. Related setup help: changing HUD scale in DefaultUI.ini.

FAQ

Why do I need a script instead of just a showhud bind?
A plain bind toggles the HUD with every press, and binding showhud directly to TAB makes it flicker. The script uses showhud on long presses so the HUD is visible only while the key is held.
Does the script work when I alt-tab or use the Steam overlay?
Yes. It only reacts when the KF2 window (KFGame.exe) is focused and supports alt-tabbing and the Steam overlay.
How do I turn it off?
Press F12 to suspend the script, then press H to bring the HUD back.