-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[windows client] ESCAPE key #10
Comments
ESC is what is generally bound to the "cancelselect" command. The cl_enginefuncs_s struct in client.dll code has a function GetFirstCmdFunctionHandle which, according to http://www.mail-archive.com/[email protected]/msg08380.html, returns a linked list of registered commands (see http://www.quakeforge.net/doxygen/group__cmd.html for what xcommand_t most likely is). It would seem likely that "cancelselect" is in this linked list of registered commands. To stop ESC from doing anything when certain conditions are met you could update the function member of cmd_function_t to only call the old value if certain conditions are met e.g.
|
Its not working for the GameMenu (mainmenu). typedef void(*xcommand_t) (void); typedef struct cmd_function_s }cmd_function_t; xcommand_t fnCancelselect; void newCancelselect(void) //Used it here to be sure the consolepanel is already there and everything will be printed inside.
|
Nice - I was kind of expecting it to not be that easy to hook ESC. |
Maybe there's a misunderstanding. The ESC key doesn't work. Equal which command is bound to it. The updated member function works if you type "cancelselect" at console. Thats what i mean with "The code itself works." My bad i havn't written it more detailed. |
Oh I see. |
Based on what i'm seeing in the engine, the engine explicitly handles the escape key and never lets the client deal with it. You are notified of it in HUD_Key_Event, but you can't choose to handle it yourself. See keydefs.h, K_ESCAPE. |
maybe a interface i.e. baseui001 or gameui007 would be able to handle it? |
I checked that, the input system passes the key event into baseui001 first, which then forwards it to gameui007. It doesn't even pass the event into the client dll when opening the menu, it only seems to happen when you close it. |
In case you didn't notice, i replied to your thread: http://twhl.info/forums.php?thread=19163&page=last |
Escape key shouldn't open the gamemenu if chat is open or a predroped building (ghostbuilding) exists as commander.
The text was updated successfully, but these errors were encountered: