input.h 1.7 KB

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