UFO: Alien Invasion
|
Header file for keyboard handler. More...
Go to the source code of this file.
Macros | |
#define | MAXKEYLINES 32 |
Functions | |
bool | Key_IsDown (unsigned int key) |
Checks whether a given key is currently pressed. More... | |
bool | Key_IsNumlock (void) |
void | Key_SetDest (keydest_t key_dest) |
Sets the keyDest in cls. More... | |
void | Key_Event (unsigned int key, unsigned short unicode, bool down, unsigned time) |
Called by the system between frames for both key up and key down events. More... | |
void | Key_Init (void) |
void | Key_WriteBindings (const char *filename) |
Writes lines containing "bind key value". More... | |
const char * | Key_GetBinding (const char *binding, keyBindSpace_t space) |
Return the key binding for a given script command. More... | |
const char * | Key_KeynumToString (int keynum) |
Convert a given keynum to string. More... | |
int | Key_StringToKeynum (const char *str) |
Convert to given string to keynum. More... | |
void | Key_SetBinding (int keynum, const char *binding, keyBindSpace_t space) |
Bind a keynum to script command. More... | |
Variables | |
int | msgMode |
char | msgBuffer [MAXCMDLINE] |
size_t | msgBufferLen |
char | keyLines [MAXKEYLINES][MAXCMDLINE] |
uint32_t | 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 keydest_t |
enum keyNum_t |
Called by the system between frames for both key up and key down events.
Definition at line 845 of file cl_keys.cpp.
References battleKeyBindings, Cbuf_AddText(), CL_OnBattlescape(), cls, Com_Error(), Con_ToggleConsole_f(), down, ERR_FATAL, i, IN_GetMouseSpace, K_ESCAPE, K_KEY_SIZE, K_MOUSE1, K_MWHEELUP, key, key_console, Key_Console(), key_game, Key_IsMouseButton(), keyBindings, client_static_s::keyDest, keyDown, menuKeyBindings, MS_UI, UI_KeyPressed(), UI_KeyRelease(), and unicode.
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 |
space | Namespace of the key binding |
Definition at line 511 of file cl_keys.cpp.
References battleKeyBindings, i, K_FIRST_KEY, K_LAST_KEY, Key_KeynumToString(), keyBindings, KEYSPACE_BATTLE, KEYSPACE_GAME, KEYSPACE_UI, menuKeyBindings, Q_streq, and Sys_Error().
Definition at line 776 of file cl_keys.cpp.
bool Key_IsDown | ( | unsigned int | key | ) |
Checks whether a given key is currently pressed.
[in] | key | The key to check, |
keyNum_t
true
if the key is pressed, false
otherwise Definition at line 214 of file cl_keys.cpp.
References K_KEY_SIZE, key, and keyDown.
Referenced by uiAbstractValueNode::getFactorFloat(), uiContainerNode::onDndFinished(), and UI_ContainerNodeDrawDropPreview().
bool Key_IsNumlock | ( | void | ) |
Definition at line 221 of file cl_keys.cpp.
Referenced by IN_TranslateKey().
const char* Key_KeynumToString | ( | int | keynum | ) |
Convert a given keynum to string.
[in] | keynum | The keynum to convert to string |
Definition at line 485 of file cl_keys.cpp.
References keyName_t::name.
Referenced by CLMN_AddBindings(), CLMN_AddUIBindings(), IN_EventEnqueue(), Key_Bindlist_f(), Key_GetBinding(), Key_WriteBindings(), UI_SetKeyBindingEx(), 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 547 of file cl_keys.cpp.
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(), and Key_Unbindall_f().
Sets the keyDest in cls.
[in] | keyDest | see keydest_t |
Definition at line 815 of file cl_keys.cpp.
References cls, key_console, client_static_s::keyDest, and UI_ReleaseInput().
Referenced by Con_Close(), Con_ToggleChat_f(), Con_ToggleConsole_f(), UI_PopWindow(), and UI_PushWindow().
int Key_StringToKeynum | ( | const char * | str | ) |
Convert to given string to keynum.
[in] | str | The keystring to convert to keynum |
Definition at line 462 of file cl_keys.cpp.
References keyName_t::name, Q_strcasecmp, and Q_strnull().
Referenced by CL_PressKey_f(), Key_Bind_f(), and Key_Unbind_f().
void Key_WriteBindings | ( | const char * | filename | ) |
Writes lines containing "bind key value".
[in] | filename | Path to print the keybinding too |
Definition at line 664 of file cl_keys.cpp.
References battleKeyBindings, binding, Com_Printf(), uiKeyBinding_s::description, f, FILE_WRITE, FS_CloseFile(), FS_Gamedir(), FS_OpenFile(), FS_Printf(), FS_RemoveFile(), i, uiKeyBinding_s::inherited, K_LAST_KEY, uiKeyBinding_s::key, Key_KeynumToString(), keyBindings, menuKeyBindings, uiKeyBinding_s::node, uiKeyBinding_s::property, 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 65 of file cl_keys.cpp.
Referenced by CLMN_InitKeyList_f(), Key_Bindlist_f(), Key_Event(), Key_GetBinding(), Key_Init(), Key_SetBinding(), and Key_WriteBindings().
int editLine |
Definition at line 42 of file cl_keys.cpp.
Referenced by Con_DrawInput(), Con_LoadConsoleHistory(), Key_ClearTyping(), and Key_Console().
int historyLine |
Definition at line 43 of file cl_keys.cpp.
Referenced by Con_LoadConsoleHistory(), Con_SaveConsoleHistory(), and Key_Console().
char* keyBindings[K_KEY_SIZE] |
Definition at line 63 of file cl_keys.cpp.
Referenced by CLMN_InitKeyList_f(), Key_Bind_f(), Key_Bindlist_f(), Key_Event(), Key_GetBinding(), Key_Init(), Key_SetBinding(), Key_Unbindall_f(), and Key_WriteBindings().
uint32_t keyLinePos |
Definition at line 38 of file cl_keys.cpp.
Referenced by Con_DrawInput(), Key_ClearTyping(), Key_Console(), and Key_Init().
char keyLines[MAXKEYLINES][MAXCMDLINE] |
Definition at line 37 of file cl_keys.cpp.
Referenced by Con_DrawInput(), Con_LoadConsoleHistory(), Con_SaveConsoleHistory(), Key_ClearTyping(), Key_Console(), and Key_Init().
char* menuKeyBindings[K_KEY_SIZE] |
Definition at line 64 of file cl_keys.cpp.
Referenced by CLMN_InitKeyList_f(), Key_Bindlist_f(), Key_Event(), Key_GetBinding(), Key_Init(), Key_SetBinding(), and Key_WriteBindings().
char msgBuffer[MAXCMDLINE] |
Definition at line 46 of file cl_keys.cpp.
size_t msgBufferLen |
Definition at line 47 of file cl_keys.cpp.
int msgMode |
Definition at line 45 of file cl_keys.cpp.