halflife icon indicating copy to clipboard operation
halflife copied to clipboard

ESC key

Open Bacsu opened this issue 8 years ago • 2 comments

  1. Key never gets keystate down=1 https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/cl_dll/input.cpp#L368

  2. cancelselect can't be hooked if it is bound to ESC https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dmc/cl_dll/ammo.cpp#L286

  3. It's not possible to bind another command than "cancelselect" to ESC key

Bacsu avatar Mar 17 '18 21:03 Bacsu

Escape is handled by the GameUI key handler. If a map is loaded then it toggles that (i.e. it opens or closes the main menu). There is no way to handle that key in game code.

SamVanheer avatar Mar 24 '18 15:03 SamVanheer

https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/cl_dll/vgui_TeamFortressViewport.cpp#L2205 the ESC key passes the KeyInput at the SDK only if it getting pressed to close the MainMenu. Isn't the idea of KeyInput to get the event anytime and handle it before it gets back to the engine?

Bacsu avatar Mar 22 '20 16:03 Bacsu