ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.59k stars 598 forks source link

ESC key #1867

Open Bacsu opened 6 years ago

Bacsu commented 6 years ago
  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

SamVanheer commented 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.

Bacsu commented 4 years ago

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?