icculus quake2 doxygen  1.0 dev
keys.c File Reference
#include "client.h"

Go to the source code of this file.

Classes

struct  keyname_t
 

Macros

#define MAXCMDLINE   256
 

Functions

void CompleteCommand (void)
 
void Key_Console (int key)
 
void Key_Message (int key)
 
int Key_StringToKeynum (char *str)
 
char * Key_KeynumToString (int keynum)
 
void Key_SetBinding (int keynum, char *binding)
 
void Key_Unbind_f (void)
 
void Key_Unbindall_f (void)
 
void Key_Bind_f (void)
 
void Key_WriteBindings (FILE *f)
 
void Key_Bindlist_f (void)
 
void Key_Init (void)
 
void Key_Event (int key, qboolean down, unsigned time)
 
void Key_ClearStates (void)
 
int Key_GetKey (void)
 

Variables

char key_lines [32][MAXCMDLINE]
 
int key_linepos
 
int shift_down =false
 
int anykeydown
 
int edit_line =0
 
int history_line =0
 
int key_waiting
 
char * keybindings [K_LAST]
 
qboolean consolekeys [K_LAST]
 
qboolean menubound [K_LAST]
 
int keyshift [K_LAST]
 
int key_repeats [K_LAST]
 
qboolean keydown [K_LAST]
 
keyname_t keynames []
 
qboolean chat_team
 
char chat_buffer [MAXCMDLINE]
 
int chat_bufferlen = 0
 

Macro Definition Documentation

◆ MAXCMDLINE

#define MAXCMDLINE   256

Definition at line 29 of file keys.c.

Function Documentation

◆ CompleteCommand()

void CompleteCommand ( void  )

Definition at line 167 of file keys.c.

168 {
169  char *cmd, *s;
170 
171  s = key_lines[edit_line]+1;
172  if (*s == '\\' || *s == '/')
173  s++;
174 
175  cmd = Cmd_CompleteCommand (s);
176  if (!cmd)
177  cmd = Cvar_CompleteVariable (s);
178  if (cmd)
179  {
180  key_lines[edit_line][1] = '/';
181  strcpy (key_lines[edit_line]+2, cmd);
182  key_linepos = strlen(cmd)+2;
184  key_linepos++;
186  return;
187  }
188 }

Referenced by Key_Console().

◆ Key_Bind_f()

void Key_Bind_f ( void  )

Definition at line 572 of file keys.c.

573 {
574  int i, c, b;
575  char cmd[1024];
576 
577  c = Cmd_Argc();
578 
579  if (c < 2)
580  {
581  Com_Printf ("bind <key> [command] : attach a command to a key\n");
582  return;
583  }
584  b = Key_StringToKeynum (Cmd_Argv(1));
585  if (b==-1)
586  {
587  Com_Printf ("\"%s\" isn't a valid key\n", Cmd_Argv(1));
588  return;
589  }
590 
591  if (c == 2)
592  {
593  if (keybindings[b])
594  Com_Printf ("\"%s\" = \"%s\"\n", Cmd_Argv(1), keybindings[b] );
595  else
596  Com_Printf ("\"%s\" is not bound\n", Cmd_Argv(1) );
597  return;
598  }
599 
600 // copy the rest of the command line
601  cmd[0] = 0; // start out with a null string
602  for (i=2 ; i< c ; i++)
603  {
604  strcat (cmd, Cmd_Argv(i));
605  if (i != (c-1))
606  strcat (cmd, " ");
607  }
608 
609  Key_SetBinding (b, cmd);
610 }

Referenced by Key_Init().

◆ Key_Bindlist_f()

void Key_Bindlist_f ( void  )

Definition at line 635 of file keys.c.

636 {
637  int i;
638 
639  for (i=0 ; i<K_LAST ; i++)
640  if (keybindings[i] && keybindings[i][0])
641  Com_Printf ("%s \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
642 }

Referenced by Key_Init().

◆ Key_ClearStates()

void Key_ClearStates ( void  )

Definition at line 919 of file keys.c.

920 {
921  int i;
922 
923  anykeydown = false;
924 
925  for (i=0 ; i<K_LAST ; i++)
926  {
927  if ( keydown[i] || key_repeats[i] )
928  Key_Event( i, false, 0 );
929  keydown[i] = 0;
930  key_repeats[i] = 0;
931  }
932 }

Referenced by AppActivate(), and M_ForceMenuOff().

◆ Key_Console()

void Key_Console ( int  key)

Definition at line 197 of file keys.c.

198 {
199 
200  switch ( key )
201  {
202  case K_KP_SLASH:
203  key = '/';
204  break;
205  case K_KP_MINUS:
206  key = '-';
207  break;
208  case K_KP_PLUS:
209  key = '+';
210  break;
211  case K_KP_HOME:
212  key = '7';
213  break;
214  case K_KP_UPARROW:
215  key = '8';
216  break;
217  case K_KP_PGUP:
218  key = '9';
219  break;
220  case K_KP_LEFTARROW:
221  key = '4';
222  break;
223  case K_KP_5:
224  key = '5';
225  break;
226  case K_KP_RIGHTARROW:
227  key = '6';
228  break;
229  case K_KP_END:
230  key = '1';
231  break;
232  case K_KP_DOWNARROW:
233  key = '2';
234  break;
235  case K_KP_PGDN:
236  key = '3';
237  break;
238  case K_KP_INS:
239  key = '0';
240  break;
241  case K_KP_DEL:
242  key = '.';
243  break;
244  default:
245  break;
246  }
247 
248  if ( ( toupper( key ) == 'V' && keydown[K_CTRL] ) ||
249  ( ( ( key == K_INS ) || ( key == K_KP_INS ) ) && keydown[K_SHIFT] ) )
250  {
251  char *cbd;
252 
253  if ( ( cbd = Sys_GetClipboardData() ) != 0 )
254  {
255  int i;
256 
257  strtok( cbd, "\n\r\b" );
258 
259  i = strlen( cbd );
260  if ( i + key_linepos >= MAXCMDLINE)
262 
263  if ( i > 0 )
264  {
265  cbd[i]=0;
266  strcat( key_lines[edit_line], cbd );
267  key_linepos += i;
268  }
269  free( cbd );
270  }
271 
272  return;
273  }
274 
275  if ( key == 'l' )
276  {
277  if ( keydown[K_CTRL] )
278  {
279  Cbuf_AddText ("clear\n");
280  return;
281  }
282  }
283 
284  if ( key == K_ENTER || key == K_KP_ENTER )
285  { // backslash text are commands, else chat
286  if (key_lines[edit_line][1] == '\\' || key_lines[edit_line][1] == '/')
287  Cbuf_AddText (key_lines[edit_line]+2); // skip the >
288  else
289  Cbuf_AddText (key_lines[edit_line]+1); // valid command
290 
291  Cbuf_AddText ("\n");
292  Com_Printf ("%s\n",key_lines[edit_line]);
293  edit_line = (edit_line + 1) & 31;
295  key_lines[edit_line][0] = ']';
296  key_linepos = 1;
297  if (cls.state == ca_disconnected)
298  SCR_UpdateScreen (); // force an update, because the command
299  // may take some time
300  return;
301  }
302 
303  if (key == K_TAB)
304  { // command completion
305  CompleteCommand ();
306  return;
307  }
308 
309  if ( ( key == K_BACKSPACE ) || ( key == K_LEFTARROW ) || ( key == K_KP_LEFTARROW ) || ( ( key == 'h' ) && ( keydown[K_CTRL] ) ) )
310  {
311  if (key_linepos > 1)
312  key_linepos--;
313  return;
314  }
315 
316  if ( ( key == K_UPARROW ) || ( key == K_KP_UPARROW ) ||
317  ( ( key == 'p' ) && keydown[K_CTRL] ) )
318  {
319  do
320  {
321  history_line = (history_line - 1) & 31;
322  } while (history_line != edit_line
323  && !key_lines[history_line][1]);
324  if (history_line == edit_line)
325  history_line = (edit_line+1)&31;
327  key_linepos = strlen(key_lines[edit_line]);
328  return;
329  }
330 
331  if ( ( key == K_DOWNARROW ) || ( key == K_KP_DOWNARROW ) ||
332  ( ( key == 'n' ) && keydown[K_CTRL] ) )
333  {
334  if (history_line == edit_line) return;
335  do
336  {
337  history_line = (history_line + 1) & 31;
338  }
339  while (history_line != edit_line
340  && !key_lines[history_line][1]);
341  if (history_line == edit_line)
342  {
343  key_lines[edit_line][0] = ']';
344  key_linepos = 1;
345  }
346  else
347  {
349  key_linepos = strlen(key_lines[edit_line]);
350  }
351  return;
352  }
353 
354  if (key == K_PGUP || key == K_KP_PGUP )
355  {
356  con.display -= 2;
357  return;
358  }
359 
360  if (key == K_PGDN || key == K_KP_PGDN )
361  {
362  con.display += 2;
363  if (con.display > con.current)
365  return;
366  }
367 
368  if (key == K_HOME || key == K_KP_HOME )
369  {
370  con.display = con.current - con.totallines + 10;
371  return;
372  }
373 
374  if (key == K_END || key == K_KP_END )
375  {
377  return;
378  }
379 
380  if (key < 32 || key > 127)
381  return; // non printable
382 
383  if (key_linepos < MAXCMDLINE-1)
384  {
386  key_linepos++;
388  }
389 
390 }

Referenced by Key_Event().

◆ Key_Event()

void Key_Event ( int  key,
qboolean  down,
unsigned  time 
)

Definition at line 745 of file keys.c.

746 {
747  char *kb;
748  char cmd[1024];
749 
750  // hack for modal presses
751  if (key_waiting == -1)
752  {
753  if (down)
754  key_waiting = key;
755  return;
756  }
757 
758  // update auto-repeat status
759  if (down)
760  {
761  key_repeats[key]++;
762  if (key != K_BACKSPACE
763  && key != K_PAUSE
764  && key != K_PGUP
765  && key != K_KP_PGUP
766  && key != K_PGDN
767  && key != K_KP_PGDN
768  && key_repeats[key] > 1)
769  return; // ignore most autorepeats
770 
771  if (key >= 200 && !keybindings[key])
772  Com_Printf ("%s is unbound, hit F4 to set.\n", Key_KeynumToString (key) );
773  }
774  else
775  {
776  key_repeats[key] = 0;
777  }
778 
779  if (key == K_SHIFT)
780  shift_down = down;
781 
782  // console key is hardcoded, so the user can never unbind it
783  if (key == '`' || key == '~')
784  {
785  if (!down)
786  return;
788  return;
789  }
790 
791  // any key during the attract mode will bring up the menu
792  if (cl.attractloop && cls.key_dest != key_menu &&
793  !(key >= K_F1 && key <= K_F12))
794  key = K_ESCAPE;
795 
796  // menu key is hardcoded, so the user can never unbind it
797  if (key == K_ESCAPE)
798  {
799  if (!down)
800  return;
801 
803  { // put away help computer / inventory
804  Cbuf_AddText ("cmd putaway\n");
805  return;
806  }
807  switch (cls.key_dest)
808  {
809  case key_message:
810  Key_Message (key);
811  break;
812  case key_menu:
813  M_Keydown (key);
814  break;
815  case key_game:
816  case key_console:
817  M_Menu_Main_f ();
818  break;
819  default:
820  Com_Error (ERR_FATAL, "Bad cls.key_dest");
821  }
822  return;
823  }
824 
825  // track if any key is down for BUTTON_ANY
826  keydown[key] = down;
827  if (down)
828  {
829  if (key_repeats[key] == 1)
830  anykeydown++;
831  }
832  else
833  {
834  anykeydown--;
835  if (anykeydown < 0)
836  anykeydown = 0;
837  }
838 
839 //
840 // key up events only generate commands if the game key binding is
841 // a button command (leading + sign). These will occur even in console mode,
842 // to keep the character from continuing an action started before a console
843 // switch. Button commands include the kenum as a parameter, so multiple
844 // downs can be matched with ups
845 //
846  if (!down)
847  {
848  kb = keybindings[key];
849  if (kb && kb[0] == '+')
850  {
851  Com_sprintf (cmd, sizeof(cmd), "-%s %i %i\n", kb+1, key, time);
852  Cbuf_AddText (cmd);
853  }
854  if (keyshift[key] != key)
855  {
856  kb = keybindings[keyshift[key]];
857  if (kb && kb[0] == '+')
858  {
859  Com_sprintf (cmd, sizeof(cmd), "-%s %i %i\n", kb+1, key, time);
860  Cbuf_AddText (cmd);
861  }
862  }
863  return;
864  }
865 
866 //
867 // if not a consolekey, send to the interpreter no matter what mode is
868 //
869  if ( (cls.key_dest == key_menu && menubound[key])
870  || (cls.key_dest == key_console && !consolekeys[key])
871  || (cls.key_dest == key_game && ( cls.state == ca_active || !consolekeys[key] ) ) )
872  {
873  kb = keybindings[key];
874  if (kb)
875  {
876  if (kb[0] == '+')
877  { // button commands add keynum and time as a parm
878  Com_sprintf (cmd, sizeof(cmd), "%s %i %i\n", kb, key, time);
879  Cbuf_AddText (cmd);
880  }
881  else
882  {
883  Cbuf_AddText (kb);
884  Cbuf_AddText ("\n");
885  }
886  }
887  return;
888  }
889 
890  if (!down)
891  return; // other systems only care about key down events
892 
893  if (shift_down)
894  key = keyshift[key];
895 
896  switch (cls.key_dest)
897  {
898  case key_message:
899  Key_Message (key);
900  break;
901  case key_menu:
902  M_Keydown (key);
903  break;
904 
905  case key_game:
906  case key_console:
907  Key_Console (key);
908  break;
909  default:
910  Com_Error (ERR_FATAL, "Bad cls.key_dest");
911  }
912 }

Referenced by IN_Commands(), IN_MouseEvent(), Key_ClearStates(), and MainWndProc().

◆ Key_GetKey()

int Key_GetKey ( void  )

Definition at line 940 of file keys.c.

941 {
942  key_waiting = -1;
943 
944  while (key_waiting == -1)
946 
947  return key_waiting;
948 }

◆ Key_Init()

void Key_Init ( void  )

Definition at line 650 of file keys.c.

651 {
652  int i;
653 
654  for (i=0 ; i<32 ; i++)
655  {
656  key_lines[i][0] = ']';
657  key_lines[i][1] = 0;
658  }
659  key_linepos = 1;
660 
661 //
662 // init ascii characters in console mode
663 //
664  for (i=32 ; i<128 ; i++)
665  consolekeys[i] = true;
666  consolekeys[K_ENTER] = true;
667  consolekeys[K_KP_ENTER] = true;
668  consolekeys[K_TAB] = true;
669  consolekeys[K_LEFTARROW] = true;
670  consolekeys[K_KP_LEFTARROW] = true;
671  consolekeys[K_RIGHTARROW] = true;
673  consolekeys[K_UPARROW] = true;
674  consolekeys[K_KP_UPARROW] = true;
675  consolekeys[K_DOWNARROW] = true;
676  consolekeys[K_KP_DOWNARROW] = true;
677  consolekeys[K_BACKSPACE] = true;
678  consolekeys[K_HOME] = true;
679  consolekeys[K_KP_HOME] = true;
680  consolekeys[K_END] = true;
681  consolekeys[K_KP_END] = true;
682  consolekeys[K_PGUP] = true;
683  consolekeys[K_KP_PGUP] = true;
684  consolekeys[K_PGDN] = true;
685  consolekeys[K_KP_PGDN] = true;
686  consolekeys[K_SHIFT] = true;
687  consolekeys[K_INS] = true;
688  consolekeys[K_KP_INS] = true;
689  consolekeys[K_KP_DEL] = true;
690  consolekeys[K_KP_SLASH] = true;
691  consolekeys[K_KP_PLUS] = true;
692  consolekeys[K_KP_MINUS] = true;
693  consolekeys[K_KP_5] = true;
694 
695  consolekeys['`'] = false;
696  consolekeys['~'] = false;
697 
698  for (i=0 ; i<K_LAST ; i++)
699  keyshift[i] = i;
700  for (i='a' ; i<='z' ; i++)
701  keyshift[i] = i - 'a' + 'A';
702  keyshift['1'] = '!';
703  keyshift['2'] = '@';
704  keyshift['3'] = '#';
705  keyshift['4'] = '$';
706  keyshift['5'] = '%';
707  keyshift['6'] = '^';
708  keyshift['7'] = '&';
709  keyshift['8'] = '*';
710  keyshift['9'] = '(';
711  keyshift['0'] = ')';
712  keyshift['-'] = '_';
713  keyshift['='] = '+';
714  keyshift[','] = '<';
715  keyshift['.'] = '>';
716  keyshift['/'] = '?';
717  keyshift[';'] = ':';
718  keyshift['\''] = '"';
719  keyshift['['] = '{';
720  keyshift[']'] = '}';
721  keyshift['`'] = '~';
722  keyshift['\\'] = '|';
723 
724  menubound[K_ESCAPE] = true;
725  for (i=0 ; i<12 ; i++)
726  menubound[K_F1+i] = true;
727 
728 //
729 // register our functions
730 //
731  Cmd_AddCommand ("bind",Key_Bind_f);
732  Cmd_AddCommand ("unbind",Key_Unbind_f);
733  Cmd_AddCommand ("unbindall",Key_Unbindall_f);
734  Cmd_AddCommand ("bindlist",Key_Bindlist_f);
735 }

Referenced by Qcommon_Init().

◆ Key_KeynumToString()

char* Key_KeynumToString ( int  keynum)

Definition at line 482 of file keys.c.

483 {
484  keyname_t *kn;
485  static char tinystr[2];
486 
487  if (keynum == -1)
488  return "<KEY NOT FOUND>";
489  if (keynum > 32 && keynum < 127)
490  { // printable ascii
491  tinystr[0] = keynum;
492  tinystr[1] = 0;
493  return tinystr;
494  }
495 
496  for (kn=keynames ; kn->name ; kn++)
497  if (keynum == kn->keynum)
498  return kn->name;
499 
500  return "<UNKNOWN KEYNUM>";
501 }

Referenced by CL_DrawInventory(), DrawKeyBindingFunc(), Key_Bindlist_f(), Key_Event(), Key_WriteBindings(), and Keys_MenuKey().

◆ Key_Message()

void Key_Message ( int  key)

Definition at line 398 of file keys.c.

399 {
400 
401  if ( key == K_ENTER || key == K_KP_ENTER )
402  {
403  if (chat_team)
404  Cbuf_AddText ("say_team \"");
405  else
406  Cbuf_AddText ("say \"");
408  Cbuf_AddText("\"\n");
409 
411  chat_bufferlen = 0;
412  chat_buffer[0] = 0;
413  return;
414  }
415 
416  if (key == K_ESCAPE)
417  {
419  chat_bufferlen = 0;
420  chat_buffer[0] = 0;
421  return;
422  }
423 
424  if (key < 32 || key > 127)
425  return; // non printable
426 
427  if (key == K_BACKSPACE)
428  {
429  if (chat_bufferlen)
430  {
431  chat_bufferlen--;
433  }
434  return;
435  }
436 
437  if (chat_bufferlen == sizeof(chat_buffer)-1)
438  return; // all full
439 
440  chat_buffer[chat_bufferlen++] = key;
442 }

Referenced by Key_Event().

◆ Key_SetBinding()

void Key_SetBinding ( int  keynum,
char *  binding 
)

Definition at line 509 of file keys.c.

510 {
511  char *new;
512  int l;
513 
514  if (keynum == -1)
515  return;
516 
517 // free old bindings
518  if (keybindings[keynum])
519  {
520  Z_Free (keybindings[keynum]);
521  keybindings[keynum] = NULL;
522  }
523 
524 // allocate memory for new binding
525  l = strlen (binding);
526  new = Z_Malloc (l+1);
527  strcpy (new, binding);
528  new[l] = 0;
529  keybindings[keynum] = new;
530 }

Referenced by Key_Bind_f(), Key_Unbind_f(), Key_Unbindall_f(), and M_UnbindCommand().

◆ Key_StringToKeynum()

int Key_StringToKeynum ( char *  str)

Definition at line 456 of file keys.c.

457 {
458  keyname_t *kn;
459 
460  if (!str || !str[0])
461  return -1;
462  if (!str[1])
463  return str[0];
464 
465  for (kn=keynames ; kn->name ; kn++)
466  {
467  if (!Q_strcasecmp(str,kn->name))
468  return kn->keynum;
469  }
470  return -1;
471 }

Referenced by Key_Bind_f(), and Key_Unbind_f().

◆ Key_Unbind_f()

void Key_Unbind_f ( void  )

Definition at line 537 of file keys.c.

538 {
539  int b;
540 
541  if (Cmd_Argc() != 2)
542  {
543  Com_Printf ("unbind <key> : remove commands from a key\n");
544  return;
545  }
546 
547  b = Key_StringToKeynum (Cmd_Argv(1));
548  if (b==-1)
549  {
550  Com_Printf ("\"%s\" isn't a valid key\n", Cmd_Argv(1));
551  return;
552  }
553 
554  Key_SetBinding (b, "");
555 }

Referenced by Key_Init().

◆ Key_Unbindall_f()

void Key_Unbindall_f ( void  )

Definition at line 557 of file keys.c.

558 {
559  int i;
560 
561  for (i=0 ; i<K_LAST ; i++)
562  if (keybindings[i])
563  Key_SetBinding (i, "");
564 }

Referenced by Key_Init().

◆ Key_WriteBindings()

void Key_WriteBindings ( FILE *  f)

Definition at line 619 of file keys.c.

620 {
621  int i;
622 
623  for (i=0 ; i<K_LAST ; i++)
624  if (keybindings[i] && keybindings[i][0])
625  fprintf (f, "bind %s \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
626 }

Referenced by CL_WriteConfiguration().

Variable Documentation

◆ anykeydown

int anykeydown

Definition at line 33 of file keys.c.

Referenced by CL_FinishMove(), Key_ClearStates(), and Key_Event().

◆ chat_buffer

char chat_buffer[MAXCMDLINE]

Definition at line 395 of file keys.c.

Referenced by Con_DrawNotify(), and Key_Message().

◆ chat_bufferlen

int chat_bufferlen = 0

Definition at line 396 of file keys.c.

Referenced by Con_DrawNotify(), and Key_Message().

◆ chat_team

qboolean chat_team

Definition at line 394 of file keys.c.

Referenced by Con_DrawNotify(), Con_MessageMode2_f(), Con_MessageMode_f(), and Key_Message().

◆ consolekeys

qboolean consolekeys[K_LAST]

Definition at line 40 of file keys.c.

Referenced by Key_Event(), and Key_Init().

◆ edit_line

int edit_line =0

Definition at line 35 of file keys.c.

Referenced by CompleteCommand(), Con_DrawInput(), Key_ClearTyping(), and Key_Console().

◆ history_line

int history_line =0

Definition at line 36 of file keys.c.

Referenced by Key_Console().

◆ key_linepos

int key_linepos

Definition at line 31 of file keys.c.

Referenced by CompleteCommand(), Con_DrawInput(), Key_ClearTyping(), Key_Console(), and Key_Init().

◆ key_lines

char key_lines[32][MAXCMDLINE]

Definition at line 30 of file keys.c.

Referenced by CompleteCommand(), Con_DrawInput(), Key_ClearTyping(), Key_Console(), and Key_Init().

◆ key_repeats

int key_repeats[K_LAST]

Definition at line 43 of file keys.c.

Referenced by Key_ClearStates(), and Key_Event().

◆ key_waiting

int key_waiting

Definition at line 38 of file keys.c.

Referenced by Key_Event(), and Key_GetKey().

◆ keybindings

◆ keydown

qboolean keydown[K_LAST]

Definition at line 44 of file keys.c.

Referenced by Field_Key(), Key_ClearStates(), Key_Console(), and Key_Event().

◆ keynames

keyname_t keynames[]

Definition at line 52 of file keys.c.

Referenced by Key_KeynumToString(), and Key_StringToKeynum().

◆ keyshift

int keyshift[K_LAST]

Definition at line 42 of file keys.c.

Referenced by Key_Event(), and Key_Init().

◆ menubound

qboolean menubound[K_LAST]

Definition at line 41 of file keys.c.

Referenced by Key_Event(), and Key_Init().

◆ shift_down

int shift_down =false

Definition at line 32 of file keys.c.

Referenced by Key_Event().

K_KP_PLUS
@ K_KP_PLUS
Definition: keys.h:74
keyname_t::keynum
int keynum
Definition: keys.c:49
edict_s::s
entity_state_t s
Definition: g_local.h:964
K_END
@ K_END
Definition: keys.h:58
keydown
qboolean keydown[K_LAST]
Definition: keys.c:44
K_DOWNARROW
@ K_DOWNARROW
Definition: keys.h:34
K_KP_UPARROW
@ K_KP_UPARROW
Definition: keys.h:61
client_state_t::attractloop
qboolean attractloop
Definition: client.h:173
chat_buffer
char chat_buffer[MAXCMDLINE]
Definition: keys.c:395
Key_SetBinding
void Key_SetBinding(int keynum, char *binding)
Definition: keys.c:509
ca_disconnected
@ ca_disconnected
Definition: client.h:206
Key_Event
void Key_Event(int key, qboolean down, unsigned time)
Definition: keys.c:745
K_KP_PGDN
@ K_KP_PGDN
Definition: keys.h:68
Key_StringToKeynum
int Key_StringToKeynum(char *str)
Definition: keys.c:456
M_Menu_Main_f
void M_Menu_Main_f(void)
Definition: menu.c:494
keyshift
int keyshift[K_LAST]
Definition: keys.c:42
i
int i
Definition: q_shared.c:305
keybindings
char * keybindings[K_LAST]
Definition: keys.c:39
anykeydown
int anykeydown
Definition: keys.c:33
K_KP_LEFTARROW
@ K_KP_LEFTARROW
Definition: keys.h:63
K_F12
@ K_F12
Definition: keys.h:52
ca_active
@ ca_active
Definition: client.h:209
Con_ToggleConsole_f
void Con_ToggleConsole_f(void)
Definition: console.c:75
chat_bufferlen
int chat_bufferlen
Definition: keys.c:396
key_waiting
int key_waiting
Definition: keys.c:38
K_HOME
@ K_HOME
Definition: keys.h:57
K_KP_HOME
@ K_KP_HOME
Definition: keys.h:60
K_ENTER
@ K_ENTER
Definition: keys.h:26
key_menu
@ key_menu
Definition: client.h:220
K_KP_INS
@ K_KP_INS
Definition: keys.h:70
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
K_LEFTARROW
@ K_LEFTARROW
Definition: keys.h:35
K_KP_MINUS
@ K_KP_MINUS
Definition: keys.h:73
keyname_t
Definition: keys.c:46
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: cl_scrn.c:1285
K_ESCAPE
@ K_ESCAPE
Definition: keys.h:27
Cmd_CompleteCommand
char * Cmd_CompleteCommand(char *partial)
Definition: cmd.c:772
MAXCMDLINE
#define MAXCMDLINE
Definition: keys.c:29
key_repeats
int key_repeats[K_LAST]
Definition: keys.c:43
console_t::current
int current
Definition: console.h:33
K_PGUP
@ K_PGUP
Definition: keys.h:56
consolekeys
qboolean consolekeys[K_LAST]
Definition: keys.c:40
shift_down
int shift_down
Definition: keys.c:32
Sys_SendKeyEvents
void Sys_SendKeyEvents(void)
Definition: sys_win.c:376
keyname_t::name
char * name
Definition: keys.c:48
K_KP_RIGHTARROW
@ K_KP_RIGHTARROW
Definition: keys.h:65
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
Key_Bindlist_f
void Key_Bindlist_f(void)
Definition: keys.c:635
K_PGDN
@ K_PGDN
Definition: keys.h:55
key_game
@ key_game
Definition: client.h:220
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
K_INS
@ K_INS
Definition: keys.h:53
Cvar_CompleteVariable
char * Cvar_CompleteVariable(char *partial)
Definition: cvar.c:95
Key_Unbind_f
void Key_Unbind_f(void)
Definition: keys.c:537
con
console_t con
Definition: console.c:24
key_console
@ key_console
Definition: client.h:220
NULL
#define NULL
Definition: q_shared.h:60
client_state_t::frame
frame_t frame
Definition: client.h:136
K_CTRL
@ K_CTRL
Definition: keys.h:39
K_KP_END
@ K_KP_END
Definition: keys.h:66
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
Key_KeynumToString
char * Key_KeynumToString(int keynum)
Definition: keys.c:482
history_line
int history_line
Definition: keys.c:36
Z_Malloc
void * Z_Malloc(int size)
Definition: common.c:1223
menubound
qboolean menubound[K_LAST]
Definition: keys.c:41
chat_team
qboolean chat_team
Definition: keys.c:394
K_KP_ENTER
@ K_KP_ENTER
Definition: keys.h:69
Key_Message
void Key_Message(int key)
Definition: keys.c:398
edit_line
int edit_line
Definition: keys.c:35
console_t::totallines
int totallines
Definition: console.h:40
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
key_linepos
int key_linepos
Definition: keys.c:31
K_KP_DEL
@ K_KP_DEL
Definition: keys.h:71
frame_t::playerstate
player_state_t playerstate
Definition: client.h:70
Key_Unbindall_f
void Key_Unbindall_f(void)
Definition: keys.c:557
Z_Free
void Z_Free(void *ptr)
Definition: common.c:1141
client_static_t::state
connstate_t state
Definition: client.h:224
K_KP_SLASH
@ K_KP_SLASH
Definition: keys.h:72
K_TAB
@ K_TAB
Definition: keys.h:25
K_UPARROW
@ K_UPARROW
Definition: keys.h:33
M_Keydown
void M_Keydown(int key)
Definition: menu.c:4077
keynames
keyname_t keynames[]
Definition: keys.c:52
K_SHIFT
@ K_SHIFT
Definition: keys.h:40
console_t::display
int display
Definition: console.h:35
Key_Bind_f
void Key_Bind_f(void)
Definition: keys.c:572
K_KP_5
@ K_KP_5
Definition: keys.h:64
K_KP_PGUP
@ K_KP_PGUP
Definition: keys.h:62
K_LAST
@ K_LAST
Definition: keys.h:135
key_lines
char key_lines[32][MAXCMDLINE]
Definition: keys.c:30
client_static_t::key_dest
keydest_t key_dest
Definition: client.h:225
K_PAUSE
@ K_PAUSE
Definition: keys.h:133
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
STAT_LAYOUTS
#define STAT_LAYOUTS
Definition: q_shared.h:1038
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1229
K_RIGHTARROW
@ K_RIGHTARROW
Definition: keys.h:36
Key_Console
void Key_Console(int key)
Definition: keys.c:197
cls
client_static_t cls
Definition: cl_main.c:105
key_message
@ key_message
Definition: client.h:220
cl
client_state_t cl
Definition: cl_main.c:106
Sys_GetClipboardData
char * Sys_GetClipboardData(void)
Definition: sys_win.c:401
K_BACKSPACE
@ K_BACKSPACE
Definition: keys.h:32
K_KP_DOWNARROW
@ K_KP_DOWNARROW
Definition: keys.h:67
K_F1
@ K_F1
Definition: keys.h:41
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
player_state_t::stats
short stats[MAX_STATS]
Definition: q_shared.h:1220
CompleteCommand
void CompleteCommand(void)
Definition: keys.c:167