-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.h
52 lines (39 loc) · 939 Bytes
/
config.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _CONFIG_H_
#define _CONFIG_H_
#include <stdint.h>
#define MAX_NAME_LEN 256
#define MAX_MICE 32
#define MAX_BUTTONS 32
#define DEFAULT_SCROLLMODE_SENSITIVITY .1
#define CONFIG_PATH "/etc/moused.conf"
#define LOCK_FILE "/var/lock/moused.lock"
enum action_type {
ACTION_DEFAULT = 0,
ACTION_BUTTON,
ACTION_BUTTON_TOGGLE,
ACTION_SET_SCROLLMODE,
ACTION_SET_SENSITIVITY
};
struct action {
enum action_type type;
float val;
};
struct mouse_config {
char name[256];
float sensitivity;
uint8_t scroll_swap_axes;
uint8_t scroll_invert_axes;
uint8_t scroll_inhibit_x;
uint8_t scroll_inhibit_y;
float scrollmode_sensitivity;
float scroll_sensitivity;
struct action buttons[MAX_BUTTONS];
struct action scroll_down;
struct action scroll_up;
struct action scroll_left;
struct action scroll_right;
struct mouse_config *next;
};
extern struct mouse_config *configs;
void parse_config_file(const char *path);
#endif