char *keybindings[MAX_BINDMAPS][MAX_KEYS];
static int key_bmap, key_bmap2;
-static qbyte keydown[MAX_KEYS]; // 0 = up, 1 = down, 2 = repeating
+static unsigned char keydown[MAX_KEYS]; // 0 = up, 1 = down, 2 = repeating
-typedef struct {
+typedef struct keyname_s
+{
const char *name;
int keynum;
-} keyname_t;
+}
+keyname_t;
static const keyname_t keynames[] = {
{"TAB", K_TAB},
void
Key_SetBinding (int keynum, int bindmap, const char *binding)
{
- char *new;
+ char *newbinding;
size_t l;
if (keynum == -1)
}
// allocate memory for new binding
l = strlen (binding);
- new = Z_Malloc (l + 1);
- strcpy (new, binding);
- new[l] = 0;
- keybindings[bindmap][keynum] = new;
+ newbinding = (char *)Z_Malloc (l + 1);
+ strcpy (newbinding, binding);
+ newbinding[l] = 0;
+ keybindings[bindmap][keynum] = newbinding;
}
static void
Key_In_Bind_f (void)
{
int i, c, b, m;
- char cmd[1024];
+ char cmd[MAX_INPUTLINE];
c = Cmd_Argc ();
Key_Bind_f (void)
{
int i, c, b;
- char cmd[1024];
+ char cmd[MAX_INPUTLINE];
c = Cmd_Argc ();
if(UI_Callback_IsSlotUsed(key_dest - 3))
UI_Callback_KeyDown (key, ascii);
else
- Con_Printf ("Key_Event: Bad key_dest");
+ Con_Printf ("Key_Event: Bad key_dest\n");
}
return;
}
if(UI_Callback_IsSlotUsed(key_dest - 3))
UI_Callback_KeyDown (key, ascii);
else
- Con_Printf ("Key_Event: Bad key_dest");
+ Con_Printf ("Key_Event: Bad key_dest\n");
}
}