keys.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // 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. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. // keys.h
  19. // Project: Nostril (aka Postal)
  20. //
  21. // History:
  22. // 03/31/97 JMI Started.
  23. //
  24. // 07/06/97 JMI Changed pu8ScanKey parm in KeyDescriptionToValue
  25. // call from a U8 to a short.
  26. // Also, changed g_apszButtonDescriptions to
  27. // g_apszMouseButtonDescriptions.
  28. //
  29. // 10/10/97 JMI Added g_apszJoyButtonDescriptions and
  30. // JoyButtonDescriptionToMask().
  31. //
  32. ////////////////////////////////////////////////////////////////////////////////
  33. //
  34. // Key stuff. I'm not sure if this will ever amount to more than just the
  35. // descriptions.
  36. //
  37. ////////////////////////////////////////////////////////////////////////////////
  38. #ifndef KEYS_H
  39. #define KEYS_H
  40. // Array of key descriptors.
  41. extern char* g_apszKeyDescriptions[128];
  42. // Array of button descriptors.
  43. extern char* g_apszMouseButtonDescriptions[8];
  44. // Array of joy button descriptors.
  45. extern char* g_apszJoyButtonDescriptions[18];
  46. // Given a string, returns the appropriate key code.
  47. extern short KeyDescriptionToValue( // Returns 0 on success. Returns non-zero, if
  48. // key not found.
  49. char* pszKeyDescriptor, // In: Description of key.
  50. U32* psScanKey); // Out: Key value.
  51. // Given a string, returns the appropriate button mask.
  52. extern short MouseButtonDescriptionToMask( // Returns 0 on success. Returns
  53. // non-zero, if description not
  54. // found.
  55. char* pszButtonDescriptor, // In: Description of button.
  56. U32* psButtonMask); // Out: Button mask.
  57. extern short JoyButtonDescriptionToMask( // Returns 0 on success. Returns
  58. // non-zero, if description not found.
  59. char* pszButtonDescriptor, // In: Description of button.
  60. U32* psButtonMask); // Out: Button mask.
  61. #endif // KEYS_H
  62. ////////////////////////////////////////////////////////////////////////////////
  63. // EOF
  64. ////////////////////////////////////////////////////////////////////////////////