Header file for keyboard handler. More...
Go to the source code of this file.
Defines | |
#define | MAXKEYLINES 32 |
Enumerations | |
enum | keyNum_t { K_FIRST_KEY, K_BACKSPACE = 8, K_TAB = 9, K_ENTER = 13, K_PAUSE = 19, K_ESCAPE = 27, K_SPACE = 32, K_DEL = 127, K_MOUSE1 = 200, K_MOUSE2 = 201, K_MOUSE3 = 202, K_MWHEELDOWN = 239, K_MWHEELUP = 240, K_MOUSE4 = 241, K_MOUSE5 = 242, K_KP_INS = 256, K_KP_END = 257, K_KP_DOWNARROW = 258, K_KP_PGDN = 259, K_KP_LEFTARROW = 260, K_KP_5 = 261, K_KP_RIGHTARROW = 262, K_KP_HOME = 263, K_KP_UPARROW = 264, K_KP_PGUP = 265, K_KP_DEL = 266, K_KP_SLASH = 267, K_KP_MINUS = 269, K_KP_PLUS = 270, K_KP_ENTER = 271, K_KP_NUMLOCK = 272, K_UPARROW = 273, K_DOWNARROW = 274, K_RIGHTARROW = 275, K_LEFTARROW = 276, K_HOME = 278, K_END = 279, K_PGUP = 280, K_PGDN = 281, K_F1 = 282, K_F2 = 283, K_F3 = 284, K_F4 = 285, K_F5 = 286, K_F6 = 287, K_F7 = 288, K_F8 = 289, K_F9 = 290, K_F10 = 291, K_F11 = 292, K_F12 = 293, K_F13 = 294, K_F14 = 295, K_F15 = 296, K_INS = 277, K_SHIFT = 304, K_CTRL = 306, K_ALT = 308, K_JOY1, K_JOY2, K_JOY3, K_JOY4, K_JOY5, K_JOY6, K_JOY7, K_JOY8, K_JOY9, K_JOY10, K_JOY11, K_JOY12, K_JOY13, K_JOY14, K_JOY15, K_JOY16, K_JOY17, K_JOY18, K_JOY19, K_JOY20, K_JOY21, K_JOY22, K_JOY23, K_JOY24, K_JOY25, K_JOY26, K_JOY27, K_JOY28, K_JOY29, K_JOY30, K_JOY31, K_JOY32, K_AUX1, K_AUX2, K_AUX3, K_AUX4, K_AUX5, K_AUX6, K_AUX7, K_AUX8, K_AUX9, K_AUX10, K_AUX11, K_AUX12, K_AUX13, K_AUX14, K_AUX15, K_AUX16, K_NUMLOCK, K_SUPER, K_COMPOSE, K_MODE, K_HELP, K_PRINT, K_SYSREQ, K_SCROLLOCK, K_BREAK, K_MENU, K_EURO, K_UNDO, K_COMMAND, K_CAPSLOCK, K_POWER, K_APPS, K_LAST_KEY = 511, K_KEY_SIZE = 512 } |
enum | msg_mode_t { MSG_SAY, MSG_SAY_TEAM } |
enum | keyBindSpace_t { KEYSPACE_UI, KEYSPACE_GAME, KEYSPACE_BATTLE, KEYSPACE_MAX } |
Functions | |
void | Key_SetDest (int key_dest) |
Sets the keyDest in cls. | |
void | Key_Event (unsigned int key, unsigned short unicode, qboolean down, unsigned time) |
Called by the system between frames for both key up and key down events. | |
void | Key_Init (void) |
void | Key_WriteBindings (const char *filename) |
Writes lines containing "bind key value". | |
const char * | Key_GetBinding (const char *binding, keyBindSpace_t space) |
Return the key binding for a given script command. | |
const char * | Key_KeynumToString (int keynum) |
Convert a given keynum to string. | |
void | Key_SetBinding (int keynum, const char *binding, keyBindSpace_t space) |
Bind a keynum to script command. | |
Variables | |
int | msgMode |
char | msgBuffer [MAXCMDLINE] |
size_t | msgBufferLen |
char | keyLines [MAXKEYLINES][MAXCMDLINE] |
int | keyLinePos |
int | historyLine |
int | editLine |
char * | keyBindings [K_KEY_SIZE] |
char * | menuKeyBindings [K_KEY_SIZE] |
char * | battleKeyBindings [K_KEY_SIZE] |
Header file for keyboard handler.
Definition in file cl_keys.h.
#define MAXKEYLINES 32 |
Definition at line 186 of file cl_keys.h.
Referenced by Con_LoadConsoleHistory(), Key_Console(), and Key_Init().
enum keyBindSpace_t |
enum keyNum_t |
enum msg_mode_t |
void Key_Event | ( | unsigned int | key, | |
unsigned short | unicode, | |||
qboolean | down, | |||
unsigned | time | |||
) |
Called by the system between frames for both key up and key down events.
Definition at line 921 of file cl_keys.c.
References battleKeyBindings, Cbuf_AddText(), CL_OnBattlescape(), cls, Com_Error(), Com_sprintf(), Con_ToggleConsole_f(), ERR_FATAL, i, K_ESCAPE, K_KEY_SIZE, K_MOUSE1, K_MWHEELUP, Key_Console(), key_console, key_game, Key_Message(), key_message, keyBindings, client_static_s::keyDest, keyDown, MAX_STRING_CHARS, menuKeyBindings, mouseSpace, MS_UI, and UI_KeyPressed().
Referenced by IN_SendKeyEvents().
const char* Key_GetBinding | ( | const char * | binding, | |
keyBindSpace_t | space | |||
) |
Return the key binding for a given script command.
[in] | binding | The script command to bind keynum to |
Definition at line 573 of file cl_keys.c.
References battleKeyBindings, i, K_FIRST_KEY, K_LAST_KEY, Key_KeynumToString(), keyBindings, KEYSPACE_BATTLE, KEYSPACE_GAME, KEYSPACE_UI, menuKeyBindings, and Sys_Error().
Referenced by UI_GetReferenceString(), and UI_KeyBindingNodeKeyPressed().
const char* Key_KeynumToString | ( | int | keynum | ) |
Convert a given keynum to string.
[in] | keynum | The keynum to convert to string |
Definition at line 546 of file cl_keys.c.
References keyName_t::keynum, and keyName_t::name.
Referenced by CLMN_AddBindings(), IN_EventEnqueue(), Key_Bindlist_f(), Key_GetBinding(), Key_WriteBindings(), UI_KeyBindingNodeKeyPressed(), and UI_Tooltip().
void Key_SetBinding | ( | int | keynum, | |
const char * | binding, | |||
keyBindSpace_t | space | |||
) |
Bind a keynum to script command.
[in] | keynum | Converted from string to keynum |
[in] | binding | The script command to bind keynum to |
[in] | space | The key space to bind the key for (menu, game or battle) |
Definition at line 610 of file cl_keys.c.
References battleKeyBindings, Com_DPrintf(), com_genericPool, DEBUG_CLIENT, K_KEY_SIZE, keyBindings, KEYSPACE_BATTLE, KEYSPACE_GAME, KEYSPACE_UI, Mem_Free, Mem_PoolStrDup, and menuKeyBindings.
Referenced by Key_Bind_f(), Key_Unbind_f(), Key_Unbindall_f(), and UI_KeyBindingNodeKeyPressed().
void Key_SetDest | ( | int | keyDest | ) |
Sets the keyDest in cls.
[in] | keyDest | see keydest_t |
Definition at line 907 of file cl_keys.c.
References cls, key_console, client_static_s::keyDest, and UI_ReleaseInput().
Referenced by Con_Close(), Con_MessageModeSay_f(), Con_MessageModeSayTeam_f(), Con_ToggleChat_f(), Con_ToggleConsole_f(), Key_Message(), UI_PopWindow(), and UI_PushWindowDelete().
void Key_WriteBindings | ( | const char * | filename | ) |
Writes lines containing "bind key value".
[in] | filename | Path to print the keybinding too |
Definition at line 743 of file cl_keys.c.
References battleKeyBindings, binding, Com_Printf(), qFILE_s::f, f, FILE_WRITE, FS_CloseFile(), FS_Gamedir(), FS_OpenFile(), FS_Printf(), FS_RemoveFile(), i, K_LAST_KEY, uiKeyBinding_s::key, Key_KeynumToString(), keyBindings, menuKeyBindings, uiKeyBinding_s::node, uiKeyBinding_s::property, qfalse, qtrue, value_s::string, UI_GetKeyBindingByIndex(), UI_GetKeyBindingCount(), UI_GetPath(), and va().
Referenced by CL_Shutdown(), and Key_WriteBindings_f().
char* battleKeyBindings[K_KEY_SIZE] |
Definition at line 66 of file cl_keys.c.
Referenced by CLMN_InitKeyList_f(), Key_Bindlist_f(), Key_Event(), Key_GetBinding(), Key_SetBinding(), and Key_WriteBindings().
int editLine |
Definition at line 43 of file cl_keys.c.
Referenced by Con_DrawInput(), Con_LoadConsoleHistory(), Key_ClearTyping(), and Key_Console().
int historyLine |
Definition at line 44 of file cl_keys.c.
Referenced by Con_LoadConsoleHistory(), Con_SaveConsoleHistory(), and Key_Console().
char* keyBindings[K_KEY_SIZE] |
Definition at line 64 of file cl_keys.c.
Referenced by CLMN_InitKeyList_f(), Key_Bind_f(), Key_Bindlist_f(), Key_Event(), Key_GetBinding(), Key_SetBinding(), Key_Unbindall_f(), and Key_WriteBindings().
int keyLinePos |
Definition at line 39 of file cl_keys.c.
Referenced by Con_DrawInput(), Key_ClearTyping(), Key_Console(), and Key_Init().
char keyLines[MAXKEYLINES][MAXCMDLINE] |
Definition at line 38 of file cl_keys.c.
Referenced by Con_DrawInput(), Con_LoadConsoleHistory(), Con_SaveConsoleHistory(), Key_ClearTyping(), Key_Console(), and Key_Init().
char* menuKeyBindings[K_KEY_SIZE] |
Definition at line 65 of file cl_keys.c.
Referenced by CLMN_InitKeyList_f(), Key_Bindlist_f(), Key_Event(), Key_GetBinding(), Key_SetBinding(), and Key_WriteBindings().
char msgBuffer[MAXCMDLINE] |
Definition at line 47 of file cl_keys.c.
Referenced by Con_DrawNotify(), and Key_Message().
size_t msgBufferLen |
Definition at line 48 of file cl_keys.c.
Referenced by Con_DrawNotify(), and Key_Message().
int msgMode |
Definition at line 46 of file cl_keys.c.
Referenced by Con_DrawNotify(), Con_MessageModeSay_f(), Con_MessageModeSayTeam_f(), and Key_Message().