keys.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) 2009, Google Inc.
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in
  12. * the documentation and/or other materials provided with the
  13. * distribution.
  14. * * Neither the name of Google, Inc. nor the names of its contributors
  15. * may be used to endorse or promote products derived from this
  16. * software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  21. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  22. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  23. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  24. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  25. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  26. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  27. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  28. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29. * SUCH DAMAGE.
  30. */
  31. #ifndef __DEV_KEYS_H
  32. #define __DEV_KEYS_H
  33. #include <sys/types.h>
  34. /* these are just the ascii values for the chars */
  35. #define KEY_0 0x30
  36. #define KEY_1 0x31
  37. #define KEY_2 0x32
  38. #define KEY_3 0x33
  39. #define KEY_4 0x34
  40. #define KEY_5 0x35
  41. #define KEY_6 0x36
  42. #define KEY_7 0x37
  43. #define KEY_8 0x38
  44. #define KEY_9 0x39
  45. #define KEY_A 0x61
  46. #define KEY_ESC 0x100
  47. #define KEY_F1 0x101
  48. #define KEY_F2 0x102
  49. #define KEY_F3 0x103
  50. #define KEY_F4 0x104
  51. #define KEY_F5 0x105
  52. #define KEY_F6 0x106
  53. #define KEY_F7 0x107
  54. #define KEY_F8 0x108
  55. #define KEY_F9 0x109
  56. #define KEY_LEFT 0x110
  57. #define KEY_RIGHT 0x111
  58. #define KEY_UP 0x112
  59. #define KEY_DOWN 0x113
  60. #define KEY_CENTER 0x114
  61. #define KEY_VOLUMEUP 0x115
  62. #define KEY_VOLUMEDOWN 0x116
  63. #define KEY_MUTE 0x117
  64. #define KEY_SOUND 0x118
  65. #define KEY_SOFT1 0x11a
  66. #define KEY_SOFT2 0x11b
  67. #define KEY_STAR 0x11c
  68. #define KEY_SHARP 0x11d
  69. #define KEY_MAIL 0x11e
  70. #define KEY_SEND 0x120
  71. #define KEY_CLEAR 0x121
  72. #define KEY_HOME 0x122
  73. #define KEY_BACK 0x123
  74. #define KEY_MENU 0x124
  75. #define MAX_KEYS 0x1ff
  76. void keys_init(void);
  77. void keys_post_event(uint16_t code, int16_t value);
  78. int keys_get_state(uint16_t code);
  79. #endif /* __DEV_KEYS_H */