root / keymaps.h @ 6ce0ca12
History | View | Annotate | Download (2 kB)
1 | 5f5aed22 | aliguori | /*
|
---|---|---|---|
2 | 5f5aed22 | aliguori | * QEMU keysym to keycode conversion using rdesktop keymaps
|
3 | 5f5aed22 | aliguori | *
|
4 | 5f5aed22 | aliguori | * Copyright (c) 2004 Johannes Schindelin
|
5 | 5f5aed22 | aliguori | *
|
6 | 5f5aed22 | aliguori | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 5f5aed22 | aliguori | * of this software and associated documentation files (the "Software"), to deal
|
8 | 5f5aed22 | aliguori | * in the Software without restriction, including without limitation the rights
|
9 | 5f5aed22 | aliguori | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | 5f5aed22 | aliguori | * copies of the Software, and to permit persons to whom the Software is
|
11 | 5f5aed22 | aliguori | * furnished to do so, subject to the following conditions:
|
12 | 5f5aed22 | aliguori | *
|
13 | 5f5aed22 | aliguori | * The above copyright notice and this permission notice shall be included in
|
14 | 5f5aed22 | aliguori | * all copies or substantial portions of the Software.
|
15 | 5f5aed22 | aliguori | *
|
16 | 5f5aed22 | aliguori | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | 5f5aed22 | aliguori | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | 5f5aed22 | aliguori | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | 5f5aed22 | aliguori | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | 5f5aed22 | aliguori | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | 5f5aed22 | aliguori | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 5f5aed22 | aliguori | * THE SOFTWARE.
|
23 | 5f5aed22 | aliguori | */
|
24 | 5f5aed22 | aliguori | |
25 | 5f5aed22 | aliguori | #ifndef __QEMU_KEYMAPS_H__
|
26 | 5f5aed22 | aliguori | #define __QEMU_KEYMAPS_H__
|
27 | 5f5aed22 | aliguori | |
28 | 5f5aed22 | aliguori | #include "qemu-common.h" |
29 | 5f5aed22 | aliguori | |
30 | 5f5aed22 | aliguori | typedef struct { |
31 | 5f5aed22 | aliguori | const char* name; |
32 | 5f5aed22 | aliguori | int keysym;
|
33 | 5f5aed22 | aliguori | } name2keysym_t; |
34 | 5f5aed22 | aliguori | |
35 | 5f5aed22 | aliguori | struct key_range {
|
36 | 5f5aed22 | aliguori | int start;
|
37 | 5f5aed22 | aliguori | int end;
|
38 | 5f5aed22 | aliguori | struct key_range *next;
|
39 | 5f5aed22 | aliguori | }; |
40 | 5f5aed22 | aliguori | |
41 | 5f5aed22 | aliguori | #define MAX_NORMAL_KEYCODE 512 |
42 | 5f5aed22 | aliguori | #define MAX_EXTRA_COUNT 256 |
43 | 5f5aed22 | aliguori | typedef struct { |
44 | 5f5aed22 | aliguori | uint16_t keysym2keycode[MAX_NORMAL_KEYCODE]; |
45 | 5f5aed22 | aliguori | struct {
|
46 | 5f5aed22 | aliguori | int keysym;
|
47 | 5f5aed22 | aliguori | uint16_t keycode; |
48 | 5f5aed22 | aliguori | } keysym2keycode_extra[MAX_EXTRA_COUNT]; |
49 | 5f5aed22 | aliguori | int extra_count;
|
50 | 5f5aed22 | aliguori | struct key_range *keypad_range;
|
51 | 5f5aed22 | aliguori | struct key_range *numlock_range;
|
52 | 5f5aed22 | aliguori | } kbd_layout_t; |
53 | 5f5aed22 | aliguori | |
54 | 5f5aed22 | aliguori | |
55 | 5f5aed22 | aliguori | void *init_keyboard_layout(const name2keysym_t *table, const char *language); |
56 | 5f5aed22 | aliguori | int keysym2scancode(void *kbd_layout, int keysym); |
57 | 5f5aed22 | aliguori | int keycode_is_keypad(void *kbd_layout, int keycode); |
58 | 5f5aed22 | aliguori | int keysym_is_numlock(void *kbd_layout, int keysym); |
59 | 5f5aed22 | aliguori | |
60 | 5f5aed22 | aliguori | #endif /* __QEMU_KEYMAPS_H__ */ |