summaryrefslogtreecommitdiff
path: root/rcm-server-keymap.h
blob: be6658289f2f1e461ae38f8bdbf5326d0d29ac57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef foorcmserverkeymaphfoo
#define foorcmserverkeymaphfoo

struct keycode {
	unsigned protocol;
	uint64_t scancode;
	struct linux_input_keycode *lik;
};

struct keymap {
	char *id;
	char *name;
	char *description;
	uint16_t rows;
	uint16_t cols;
	struct list_head list;
	struct keycode **layout;
	unsigned keycode_count;
	struct keycode keycodes[];
};

struct keymap *find_keymap_by_id(struct rc_device *rcdev, const char *id);

struct keymap *keymap_read(int dfd, const char *path, const char *filename);

int keymaps_load(struct rc_device *rcdev);

int keymap_write(struct keymap *keymap);

void keymap_free(struct keymap *keymap);

DEFINE_TRIVIAL_CLEANUP_FUNC(struct keymap *, keymap_free);
#define _cleanup_keymap_free_ _cleanup_(keymap_freep)

#endif