================= Menu_HandleKey ================= */
| 11156 | ================= |
| 11157 | */ |
| 11158 | void Menu_HandleKey(menuDef_t *menu, int key, qboolean down) |
| 11159 | { |
| 11160 | int i; |
| 11161 | itemDef_t *item = NULL; |
| 11162 | qboolean inHandler = qfalse; |
| 11163 | |
| 11164 | if (inHandler) |
| 11165 | { |
| 11166 | return; |
| 11167 | } |
| 11168 | |
| 11169 | inHandler = qtrue; |
| 11170 | if (g_waitingForKey && down) |
| 11171 | { |
| 11172 | Item_Bind_HandleKey(g_bindItem, key, down); |
| 11173 | inHandler = qfalse; |
| 11174 | return; |
| 11175 | } |
| 11176 | |
| 11177 | if (g_editingField && down) |
| 11178 | { |
| 11179 | if (!Item_TextField_HandleKey(g_editItem, key)) |
| 11180 | { |
| 11181 | g_editingField = qfalse; |
| 11182 | g_editItem = NULL; |
| 11183 | inHandler = qfalse; |
| 11184 | return; |
| 11185 | } |
| 11186 | else if (key == A_MOUSE1 || key == A_MOUSE2 || key == A_MOUSE3) |
| 11187 | { |
| 11188 | g_editingField = qfalse; |
| 11189 | g_editItem = NULL; |
| 11190 | Display_MouseMove(NULL, DC->cursorx, DC->cursory); |
| 11191 | } |
| 11192 | else if (key == A_TAB || key == A_CURSOR_UP || key == A_CURSOR_DOWN) |
| 11193 | { |
| 11194 | return; |
| 11195 | } |
| 11196 | } |
| 11197 | |
| 11198 | if (menu == NULL) |
| 11199 | { |
| 11200 | inHandler = qfalse; |
| 11201 | return; |
| 11202 | } |
| 11203 | |
| 11204 | //JLFMOUSE MPMOVED |
| 11205 | // see if the mouse is within the window bounds and if so is this a mouse click |
| 11206 | if (down && !(menu->window.flags & WINDOW_POPUP) && !Rect_ContainsPoint(&menu->window.rect, DC->cursorx, DC->cursory)) |
| 11207 | { |
| 11208 | static qboolean inHandleKey = qfalse; |
| 11209 | if (!inHandleKey && (key == A_MOUSE1 || key == A_MOUSE2 || key == A_MOUSE3)) |
| 11210 | { |
| 11211 | inHandleKey = qtrue; |
| 11212 | Menus_HandleOOBClick(menu, key, down); |
| 11213 | inHandleKey = qfalse; |
| 11214 | inHandler = qfalse; |
| 11215 | return; |
no test coverage detected