input.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* -*- mode: c; tab-width: 4; c-basic-offset: 3; c-file-style: "linux" -*- */
  2. //
  3. // Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
  4. // All rights reserved.
  5. //
  6. // This file is part of SDLPAL.
  7. //
  8. // SDLPAL is free software: you can redistribute it and/or modify
  9. // it under the terms of the GNU General Public License as published by
  10. // the Free Software Foundation, either version 3 of the License, or
  11. // (at your option) any later version.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU General Public License
  19. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. //
  21. #ifndef INPUT_H
  22. #define INPUT_H
  23. #include "common.h"
  24. #include "palcommon.h"
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29. typedef struct tagPALINPUTSTATE
  30. {
  31. PALDIRECTION dir, prevdir;
  32. DWORD dwKeyPress;
  33. } PALINPUTSTATE;
  34. extern PALINPUTSTATE g_InputState;
  35. enum PALKEY
  36. {
  37. kKeyMenu = (1 << 0),
  38. kKeySearch = (1 << 1),
  39. kKeyDown = (1 << 2),
  40. kKeyLeft = (1 << 3),
  41. kKeyUp = (1 << 4),
  42. kKeyRight = (1 << 5),
  43. kKeyPgUp = (1 << 6),
  44. kKeyPgDn = (1 << 7),
  45. kKeyRepeat = (1 << 8),
  46. kKeyAuto = (1 << 9),
  47. kKeyDefend = (1 << 10),
  48. kKeyUseItem = (1 << 11),
  49. kKeyThrowItem = (1 << 12),
  50. kKeyFlee = (1 << 13),
  51. kKeyStatus = (1 << 14),
  52. kKeyForce = (1 << 15),
  53. };
  54. VOID
  55. PAL_ClearKeyState(
  56. VOID
  57. );
  58. VOID
  59. PAL_InitInput(
  60. VOID
  61. );
  62. VOID
  63. PAL_ProcessEvent(
  64. VOID
  65. );
  66. VOID
  67. PAL_ShutdownInput(
  68. VOID
  69. );
  70. extern BOOL g_fUseJoystick;
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif