74#define M(x) {#x, K_##x}
223 return (SDL_GetModState() & KMOD_NUM) == KMOD_NUM;
239 switch (toupper(
key)) {
488 return "<KEY NOT FOUND>";
490 if (keynum > 32 && keynum < 127) {
491 static char tinystr[2];
498 if (keynum == kn->keynum)
501 return "<UNKNOWN KEYNUM>";
513 char** keySpace =
nullptr;
526 Sys_Error(
"Unknown key space (%i) given", space);
549 char** keySpace =
nullptr;
666 bool writeError =
false;
676 FS_Printf(&
f,
"// generated by ufo, do not modify\n");
677 FS_Printf(&
f,
"// If you want to know the keyname of a specific key - set in_debug cvar to 1 and press the key\n");
709 if (
binding->property ==
nullptr)
719 if (!writeError && cnt > 0) {
817 cls.keyDest = keyDest;
821 SDL_StartTextInput();
859 switch (
cls.keyDest) {
879 for (
int i = 0;
i < 3;
i++) {
880 if (kb && kb[0] ==
'+') {
901 const char* kb =
nullptr;
929 switch (
cls.keyDest) {
bool CL_OnBattlescape(void)
Check whether we are in a tactical mission as server or as client. But this only means that we are ab...
void Con_Scroll(int scroll)
Scrolls the console.
void Con_ToggleConsole_f(void)
#define CONSOLE_PROMPT_CHAR
void FS_CloseFile(qFILE *f)
char keyLines[MAXKEYLINES][MAXCMDLINE]
static void Key_Bind_f(void)
Binds a key to a given script command.
static const keyName_t keyNames[]
char * keyBindings[K_KEY_SIZE]
char msgBuffer[MAXCMDLINE]
char * menuKeyBindings[K_KEY_SIZE]
static void Key_Console(int key, int unicode)
Interactive line editing and console scrollback.
bool Key_IsDown(unsigned int key)
Checks whether a given key is currently pressed.
static void Key_WriteBindings_f(void)
const char * Key_GetBinding(const char *binding, keyBindSpace_t space)
Return the key binding for a given script command.
static bool keyDown[K_KEY_SIZE]
static void Key_Bindlist_f(void)
List all binded keys with its function.
static void Key_Unbind_f(void)
Unbind a given key binding.
void Key_SetBinding(int keynum, const char *binding, keyBindSpace_t space)
Bind a keynum to script command.
void Key_WriteBindings(const char *filename)
Writes lines containing "bind key value".
void Key_SetDest(keydest_t keyDest)
Sets the keyDest in cls.
static void Key_Unbindall_f(void)
Unbind all key bindings.
static bool Key_IsMouseButton(unsigned int key)
Returns true if the Key is a mouse event.
const char * Key_KeynumToString(int keynum)
Convert a given keynum to string.
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.
static int Key_CompleteKeyName(const char *partial, const char **match)
char * battleKeyBindings[K_KEY_SIZE]
int Key_StringToKeynum(const char *str)
Convert to given string to keynum.
Primary header for client.
const char * Cmd_Argv(int arg)
Returns a given argument.
void Cmd_AddParamCompleteFunction(const char *cmdName, int(*function)(const char *partial, const char **match))
bool Cmd_GenericCompleteFunction(char const *candidate, char const *partial, char const **match)
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
void Cbuf_AddText(const char *format,...)
Adds command text at the end of the buffer.
bool Com_ConsoleCompleteCommand(const char *s, char *target, size_t bufSize, uint32_t *pos, uint32_t offset)
Console completion for command and variables.
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Error(int code, const char *fmt,...)
void Com_Printf(const char *const fmt,...)
memPool_t * com_genericPool
int FS_Printf(qFILE *f, const char *msg,...)
Can print chunks for 1024 chars into a file.
void FS_RemoveFile(const char *osPath)
int FS_OpenFile(const char *filename, qFILE *file, filemode_t mode)
Finds and opens the file in the search path.
const char * FS_Gamedir(void)
Called to find where to write a file (savegames, etc).
void Sys_Error(const char *error,...)
#define Mem_PoolStrDup(in, pool, tagNum)
#define Q_strcasecmp(a, b)
bool Q_strnull(const char *string)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
void Com_DefaultExtension(char *path, size_t len, const char *extension)
Sets a default extension if there is none.
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
const uiKeyBinding_t * binding
const char * UI_GetPath(const uiNode_t *node)
Return a path from a window to a node.