aboutsummaryrefslogtreecommitdiff
path: root/ui/keymaps.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-02-22 08:05:09 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-02-22 10:35:14 +0100
commitfe5fca9a03ee965e039b8f5c0475032c9f950185 (patch)
tree2a7a0dd883c096735821ed5f7b8e7a338007cc7e /ui/keymaps.h
parent41126214200bc6a0e4afe28f3a9d7888f5228d08 (diff)
keymap: make struct kbd_layout_t private to ui/keymaps.c
Also use kbd_layout_t pointers instead of void pointers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20180222070513.8740-2-kraxel@redhat.com
Diffstat (limited to 'ui/keymaps.h')
-rw-r--r--ui/keymaps.h29
1 files changed, 6 insertions, 23 deletions
diff --git a/ui/keymaps.h b/ui/keymaps.h
index 8757465529..17ec03387a 100644
--- a/ui/keymaps.h
+++ b/ui/keymaps.h
@@ -32,25 +32,6 @@ typedef struct {
int keysym;
} name2keysym_t;
-struct key_range {
- int start;
- int end;
- struct key_range *next;
-};
-
-#define MAX_NORMAL_KEYCODE 512
-#define MAX_EXTRA_COUNT 256
-typedef struct {
- uint16_t keysym2keycode[MAX_NORMAL_KEYCODE];
- struct {
- int keysym;
- uint16_t keycode;
- } keysym2keycode_extra[MAX_EXTRA_COUNT];
- int extra_count;
- struct key_range *keypad_range;
- struct key_range *numlock_range;
-} kbd_layout_t;
-
/* scancode without modifiers */
#define SCANCODE_KEYMASK 0xff
/* scancode without grey or up bit */
@@ -69,10 +50,12 @@ typedef struct {
#define SCANCODE_ALT 0x400
#define SCANCODE_ALTGR 0x800
+typedef struct kbd_layout_t kbd_layout_t;
-void *init_keyboard_layout(const name2keysym_t *table, const char *language);
-int keysym2scancode(void *kbd_layout, int keysym);
-int keycode_is_keypad(void *kbd_layout, int keycode);
-int keysym_is_numlock(void *kbd_layout, int keysym);
+kbd_layout_t *init_keyboard_layout(const name2keysym_t *table,
+ const char *language);
+int keysym2scancode(kbd_layout_t *k, int keysym);
+int keycode_is_keypad(kbd_layout_t *k, int keycode);
+int keysym_is_numlock(kbd_layout_t *k, int keysym);
#endif /* QEMU_KEYMAPS_H */