Open Bacsu opened 6 years ago
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.
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?
Key never gets keystate down=1 https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/cl_dll/input.cpp#L368
cancelselect can't be hooked if it is bound to ESC https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dmc/cl_dll/ammo.cpp#L286
It's not possible to bind another command than "cancelselect" to ESC key