mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Mostly whitespace, these files are now identical and COULD be merged, if
they weren't about to get a rewrite first.
This commit is contained in:
parent
8ad00b04c3
commit
168d47402a
2 changed files with 142 additions and 157 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
keys.c
|
||||
|
||||
|
@ -72,25 +71,10 @@ keydest_t key_dest;
|
|||
|
||||
char *keybindings[256];
|
||||
qboolean consolekeys[256]; // if true, can't be rebound while in
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
// console
|
||||
qboolean menubound[256]; // if true, can't be rebound while in
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
// menu
|
||||
int keyshift[256]; // key to map to if shift held down
|
||||
|
||||
// in console
|
||||
int key_repeats[256]; // if > 1, it is autorepeating
|
||||
qboolean keydown[256];
|
||||
|
@ -291,7 +275,8 @@ Key_Console (int key)
|
|||
switch (key) {
|
||||
case K_ENTER:
|
||||
// backslash text are commands
|
||||
if (key_lines[edit_line][1] == '/' && key_lines[edit_line][2] == '/')
|
||||
if (key_lines[edit_line][1] == '/'
|
||||
&& key_lines[edit_line][2] == '/')
|
||||
goto no_lf;
|
||||
else if (key_lines[edit_line][1] == '\\'
|
||||
|| key_lines[edit_line][1] == '/')
|
||||
|
@ -670,11 +655,8 @@ Key_WriteBindings (QFile *f)
|
|||
for (i = 0; i < 256; i++)
|
||||
if (keybindings[i])
|
||||
Qprintf (f, "bind \"%s\" \"%s\"\n", Key_KeynumToString (i),
|
||||
keybindings[i]); // 1999-12-26 bound keys not saved in
|
||||
//
|
||||
//
|
||||
//
|
||||
// quotes fix by Maddes
|
||||
keybindings[i]);
|
||||
// 1999-12-26 bound keys not saved in quotes fix by Maddes
|
||||
}
|
||||
|
||||
|
||||
|
@ -805,7 +787,7 @@ Key_Event (int key, int alt_key, qboolean down)
|
|||
if ((key != K_BACKSPACE && key != K_DEL
|
||||
&& key != K_LEFTARROW && key != K_RIGHTARROW
|
||||
&& key != K_PGUP && key != K_PGDN)
|
||||
|| (key_dest == key_game && cls.state == ca_connected))
|
||||
|| (key_dest == key_game && cls.state == ca_active))
|
||||
return; // ignore most autorepeats
|
||||
}
|
||||
|
||||
|
@ -814,7 +796,7 @@ Key_Event (int key, int alt_key, qboolean down)
|
|||
Key_KeynumToString (key));
|
||||
}
|
||||
// Exit message mode is disconnected
|
||||
if (key_dest == key_message && cls.state != ca_connected)
|
||||
if (key_dest == key_message && cls.state != ca_active)
|
||||
key_dest = key_console;
|
||||
|
||||
//
|
||||
|
@ -876,7 +858,7 @@ Key_Event (int key, int alt_key, qboolean down)
|
|||
if ((key_dest == key_menu && menubound[key])
|
||||
|| (key_dest == key_console && !consolekeys[key])
|
||||
|| (key_dest == key_game
|
||||
&& (cls.state == ca_connected || !consolekeys[key]))) {
|
||||
&& (cls.state == ca_active || !consolekeys[key]))) {
|
||||
kb = keybindings[key];
|
||||
if (kb) {
|
||||
if (kb[0] == '+') { // button commands add keynum as a
|
||||
|
@ -929,3 +911,4 @@ Key_ClearStates (void)
|
|||
key_repeats[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,13 +71,10 @@ keydest_t key_dest;
|
|||
|
||||
char *keybindings[256];
|
||||
qboolean consolekeys[256]; // if true, can't be rebound while in
|
||||
|
||||
// console
|
||||
qboolean menubound[256]; // if true, can't be rebound while in
|
||||
|
||||
// menu
|
||||
int keyshift[256]; // key to map to if shift held down
|
||||
|
||||
// in console
|
||||
int key_repeats[256]; // if > 1, it is autorepeating
|
||||
qboolean keydown[256];
|
||||
|
@ -279,7 +276,8 @@ Key_Console (int key)
|
|||
case K_ENTER:
|
||||
// backslash text are commands
|
||||
if (key_lines[edit_line][1] == '/'
|
||||
&& key_lines[edit_line][2] == '/') goto no_lf;
|
||||
&& key_lines[edit_line][2] == '/')
|
||||
goto no_lf;
|
||||
else if (key_lines[edit_line][1] == '\\'
|
||||
|| key_lines[edit_line][1] == '/')
|
||||
Cbuf_AddText (key_lines[edit_line] + 2); // skip the ]/
|
||||
|
@ -657,8 +655,8 @@ Key_WriteBindings (QFile *f)
|
|||
for (i = 0; i < 256; i++)
|
||||
if (keybindings[i])
|
||||
Qprintf (f, "bind \"%s\" \"%s\"\n", Key_KeynumToString (i),
|
||||
keybindings[i]); // 1999-12-26 bound keys not saved in
|
||||
// quotes fix by Maddes
|
||||
keybindings[i]);
|
||||
// 1999-12-26 bound keys not saved in quotes fix by Maddes
|
||||
}
|
||||
|
||||
|
||||
|
@ -732,7 +730,8 @@ Key_Init (void)
|
|||
//
|
||||
// register our functions
|
||||
//
|
||||
Cmd_AddCommand ("bind", Key_Bind_f, "Assign a command or a set of commands to a key.\n"
|
||||
Cmd_AddCommand ("bind", Key_Bind_f,
|
||||
"Assign a command or a set of commands to a key.\n"
|
||||
"Note: To bind multiple commands to a key, enclose the commands in quotes and separate with semi-colons. \n"
|
||||
"To bind to non-printable keys, use the key name.\n"
|
||||
"Key Name List: Escape, F1-F12, pause, backspace, tab, semicolon, enter, shift, ctrl, alt, space, ins,\n"
|
||||
|
@ -740,8 +739,10 @@ Key_Init (void)
|
|||
"mwheelup, mwheeldown\n"
|
||||
"Special: The escape, and ~ (tilde) keys can only be bound from an external configuration file.");
|
||||
|
||||
Cmd_AddCommand ("unbind", Key_Unbind_f, "Remove the bind from the the selected key");
|
||||
Cmd_AddCommand ("unbindall", Key_Unbindall_f, "Remove all binds (USE CAUTIOUSLY!!!)");
|
||||
Cmd_AddCommand ("unbind", Key_Unbind_f,
|
||||
"Remove the bind from the the selected key");
|
||||
Cmd_AddCommand ("unbindall", Key_Unbindall_f,
|
||||
"Remove all binds (USE CAUTIOUSLY!!!)");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -910,3 +911,4 @@ Key_ClearStates (void)
|
|||
key_repeats[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue