void CG_KeyEvent(int key, qboolean down) { if (!down) { return; } if ( CG_ChatboxActive() ) { if ( key == K_ENTER || key == K_KP_ENTER ) CG_ChatboxOutgoing(); else if ( key == K_TAB ) CG_ChatboxTabComplete(); else if ( key == K_PGDN ) CG_ChatboxScroll( 0 ); else if ( key == K_PGUP ) CG_ChatboxScroll( 1 ); else if ( key == K_UPARROW ) CG_ChatboxHistoryUp(); else if ( key == K_DOWNARROW ) CG_ChatboxHistoryDn(); else if ( key == K_BACKSPACE ) CG_ChatboxClear(); else if ( key == K_ESCAPE ) CG_ChatboxEscape(); else if ( key & K_CHAR_FLAG ) CG_ChatboxChar( (char)(key & ~K_CHAR_FLAG) ); return; } if ( cg.predictedPlayerState.pm_type == PM_NORMAL || (cg.predictedPlayerState.pm_type == PM_SPECTATOR && cg.showScores == qfalse)) { CG_EventHandling(CGAME_EVENT_NONE); trap->Key_SetCatcher(0); return; } //if (key == trap->Key_GetKey("teamMenu") || !Display_CaptureItem(cgs.cursorX, cgs.cursorY)) { // if we see this then we should always be visible // CG_EventHandling(CGAME_EVENT_NONE); // trap->Key_SetCatcher(0); //} Display_HandleKey(key, down, (int)cgs.cursorX, (int)cgs.cursorY); if (cgs.capturedItem) { cgs.capturedItem = NULL; } else { if (key == K_MOUSE2 && down) { cgs.capturedItem = Display_CaptureItem((int)cgs.cursorX, (int)cgs.cursorY); } } }
static void CG_ClearChat_f( void ) { CG_ChatboxClear(); }