Vladimir Chtchetkine | 71bb14f | 2010-07-07 15:57:00 -0700 | [diff] [blame^] | 1 | /* Copyright (C) 2010 The Android Open Source Project |
| 2 | ** |
| 3 | ** This software is licensed under the terms of the GNU General Public |
| 4 | ** License version 2, as published by the Free Software Foundation, and |
| 5 | ** may be copied, distributed, and modified under those terms. |
| 6 | ** |
| 7 | ** This program is distributed in the hope that it will be useful, |
| 8 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | ** GNU General Public License for more details. |
| 11 | */ |
| 12 | #ifndef QEMU_ANDROID_KEYCODE_ARRAY_H |
| 13 | #define QEMU_ANDROID_KEYCODE_ARRAY_H |
| 14 | |
| 15 | /* Contains declarations for routines that manage keycode sequence that needs |
| 16 | * to be transferred to the emulator core for further processing. |
| 17 | */ |
| 18 | |
| 19 | /* Maximum number of keycodes kept in the array. */ |
| 20 | #define MAX_KEYCODES 256*2 |
| 21 | |
| 22 | /* Describes array of keycodes collected for transferring to the core. */ |
| 23 | typedef struct AKeycodeBuffer { |
| 24 | /* Number of keycodes collected in the array. */ |
| 25 | int keycode_count; |
| 26 | |
| 27 | /* Array of collected keycodes. */ |
| 28 | int keycodes[ MAX_KEYCODES ]; |
| 29 | } AKeycodeBuffer; |
| 30 | |
| 31 | /* Adds a key event to the array of keycodes. */ |
| 32 | void |
| 33 | android_keycodes_add_key_event( AKeycodeBuffer* keycodes, |
| 34 | unsigned code, |
| 35 | unsigned down ); |
| 36 | |
| 37 | /* Flushes (transfers) collected keycodes to the core. */ |
| 38 | void |
| 39 | android_keycodes_flush(AKeycodeBuffer* keycodes); |
| 40 | |
| 41 | #endif /* QEMU_ANDROID_KEYCODE_ARRAY_H */ |