keys.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1999-2005 Id Software, Inc.
  4. This file is part of Quake III Arena source code.
  5. Quake III Arena source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake III Arena source code is distributed in the hope that it will be
  10. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Foobar; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. #include "../ui/keycodes.h"
  19. #define MAX_KEYS 256
  20. typedef struct {
  21. qboolean down;
  22. int repeats; // if > 1, it is autorepeating
  23. char *binding;
  24. } qkey_t;
  25. extern qboolean key_overstrikeMode;
  26. extern qkey_t keys[MAX_KEYS];
  27. // NOTE TTimo the declaration of field_t and Field_Clear is now in qcommon/qcommon.h
  28. void Field_KeyDownEvent( field_t *edit, int key );
  29. void Field_CharEvent( field_t *edit, int ch );
  30. void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor );
  31. void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor );
  32. #define COMMAND_HISTORY 32
  33. extern field_t historyEditLines[COMMAND_HISTORY];
  34. extern field_t g_consoleField;
  35. extern field_t chatField;
  36. extern qboolean anykeydown;
  37. extern qboolean chat_team;
  38. extern int chat_playerNum;
  39. void Key_WriteBindings( fileHandle_t f );
  40. void Key_SetBinding( int keynum, const char *binding );
  41. char *Key_GetBinding( int keynum );
  42. qboolean Key_IsDown( int keynum );
  43. qboolean Key_GetOverstrikeMode( void );
  44. void Key_SetOverstrikeMode( qboolean state );
  45. void Key_ClearStates( void );
  46. int Key_GetKey(const char *binding);