Mike Lockwood | 9cc8899 | 2008-12-15 14:51:56 -0500 | [diff] [blame] | 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 | |
| 18 | #ifndef __LINUX_KEYCHORD_H_ |
| 19 | #define __LINUX_KEYCHORD_H_ |
| 20 | |
| 21 | #include <linux/input.h> |
| 22 | |
| 23 | #define KEYCHORD_VERSION 1 |
| 24 | |
| 25 | /* |
| 26 | * One or more input_keychord structs are written to /dev/keychord |
| 27 | * at once to specify the list of keychords to monitor. |
| 28 | * Reading /dev/keychord returns the id of a keychord when the |
| 29 | * keychord combination is pressed. A keychord is signalled when |
| 30 | * all of the keys in the keycode list are in the pressed state. |
| 31 | * The order in which the keys are pressed does not matter. |
| 32 | * The keychord will not be signalled if keys not in the keycode |
| 33 | * list are pressed. |
| 34 | * Keychords will not be signalled on key release events. |
| 35 | */ |
| 36 | struct input_keychord { |
| 37 | /* should be KEYCHORD_VERSION */ |
| 38 | __u16 version; |
| 39 | /* |
| 40 | * client specified ID, returned from read() |
| 41 | * when this keychord is pressed. |
| 42 | */ |
| 43 | __u16 id; |
| 44 | |
| 45 | /* number of keycodes in this keychord */ |
| 46 | __u16 count; |
| 47 | |
| 48 | /* variable length array of keycodes */ |
| 49 | __u16 keycodes[]; |
| 50 | }; |
| 51 | |
| 52 | #endif /* __LINUX_KEYCHORD_H_ */ |