MCPcopy Create free account
hub / github.com/JACoders/OpenJK / _UI_KeyEvent

Function _UI_KeyEvent

code/ui/ui_main.cpp:4045–4075  ·  view source on GitHub ↗

================= UI_KeyEvent ================= */

Source from the content-addressed store, hash-verified

4043=================
4044*/
4045void _UI_KeyEvent( int key, qboolean down )
4046{
4047/* extern qboolean SwallowBadNumLockedKPKey( int iKey );
4048 if (SwallowBadNumLockedKPKey(key)){
4049 return;
4050 }
4051*/
4052
4053 if (Menu_Count() > 0)
4054 {
4055 menuDef_t *menu = Menu_GetFocused();
4056 if (menu)
4057 {
4058 //DemoEnd();
4059 if (key == A_ESCAPE && down && !Menus_AnyFullScreenVisible() && !(menu->window.flags & WINDOW_IGNORE_ESCAPE))
4060 {
4061 Menus_CloseAll();
4062 }
4063 else
4064 {
4065 Menu_HandleKey(menu, key, down );
4066 }
4067 }
4068 else
4069 {
4070 trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI );
4071 trap_Key_ClearStates();
4072 Cvar_Set( "cl_paused", "0" );
4073 }
4074 }
4075}
4076
4077/*
4078=================

Callers 3

CL_KeyDownEventFunction · 0.85
CL_KeyUpEventFunction · 0.85
CL_CharEventFunction · 0.85

Calls 9

Menu_CountFunction · 0.70
Menu_GetFocusedFunction · 0.70
Menus_CloseAllFunction · 0.70
Menu_HandleKeyFunction · 0.70
trap_Key_SetCatcherFunction · 0.70
trap_Key_GetCatcherFunction · 0.70
trap_Key_ClearStatesFunction · 0.70
Cvar_SetFunction · 0.50

Tested by

no test coverage detected