================= UI_KeyEvent ================= */
| 4043 | ================= |
| 4044 | */ |
| 4045 | void _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 | ================= |
no test coverage detected