| 1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 |
#ifndef __KEYMAP_H |
| 3 |
#define __KEYMAP_H |
| 4 |
|
| 5 |
#include <stdint.h> |
| 6 |
|
| 7 |
struct keymap { |
| 8 |
struct keymap *next; |
| 9 |
char *name; |
| 10 |
char *protocol; |
| 11 |
char *variant; |
| 12 |
struct protocol_param *param; |
| 13 |
struct scancode_entry *scancode; |
| 14 |
struct raw_entry *raw; |
| 15 |
}; |
| 16 |
|
| 17 |
struct protocol_param { |
| 18 |
struct protocol_param *next; |
| 19 |
char *name; |
| 20 |
long int value; |
| 21 |
}; |
| 22 |
|
| 23 |
struct scancode_entry { |
| 24 |
struct scancode_entry *next; |
| 25 |
uint64_t scancode; |
| 26 |
char *keycode; |
| 27 |
}; |
| 28 |
|
| 29 |
struct raw_entry { |
| 30 |
struct raw_entry *next; |
| 31 |
uint64_t scancode; |
| 32 |
uint32_t raw_length; |
| 33 |
char *keycode; |
| 34 |
uint32_t raw[1]; |
| 35 |
}; |
| 36 |
|
| 37 |
void free_keymap(struct keymap *map); |
| 38 |
error_t parse_keymap(char *fname, struct keymap **keymap, bool verbose); |
| 39 |
int keymap_param(struct keymap *map, const char *name, int fallback); |
| 40 |
|
| 41 |
#endif |