keychord.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Key chord input driver
  3. *
  4. * Copyright (C) 2008 Google, Inc.
  5. * Author: Mike Lockwood <lockwood@android.com>
  6. *
  7. * This software is licensed under the terms of the GNU General Public
  8. * License version 2, as published by the Free Software Foundation, and
  9. * may be copied, distributed, and modified under those terms.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. */
  17. #ifndef __LINUX_KEYCHORD_H_
  18. #define __LINUX_KEYCHORD_H_
  19. #include <linux/input.h>
  20. #define KEYCHORD_VERSION 1
  21. /*
  22. * One or more input_keychord structs are written to /dev/keychord
  23. * at once to specify the list of keychords to monitor.
  24. * Reading /dev/keychord returns the id of a keychord when the
  25. * keychord combination is pressed. A keychord is signalled when
  26. * all of the keys in the keycode list are in the pressed state.
  27. * The order in which the keys are pressed does not matter.
  28. * The keychord will not be signalled if keys not in the keycode
  29. * list are pressed.
  30. * Keychords will not be signalled on key release events.
  31. */
  32. struct input_keychord {
  33. /* should be KEYCHORD_VERSION */
  34. __u16 version;
  35. /*
  36. * client specified ID, returned from read()
  37. * when this keychord is pressed.
  38. */
  39. __u16 id;
  40. /* number of keycodes in this keychord */
  41. __u16 count;
  42. /* variable length array of keycodes */
  43. __u16 keycodes[];
  44. };
  45. #endif /* __LINUX_KEYCHORD_H_ */