feat: tablet support

This commit is contained in:
werapi 2026-05-21 13:35:58 +08:00 committed by DreamMaoMao
parent ac437aa8e4
commit 713e977314
4 changed files with 491 additions and 11 deletions

View file

@ -284,6 +284,9 @@ typedef struct {
double mouse_accel_speed;
double axis_scroll_factor;
/* tablet */
char *tablet_map_to_mon;
/* Trackpad */
int32_t trackpad_natural_scrolling;
uint32_t trackpad_accel_profile;
@ -1671,6 +1674,10 @@ bool parse_option(Config *config, char *key, char *value) {
config->button_map = atoi(value);
} else if (strcmp(key, "axis_scroll_factor") == 0) {
config->axis_scroll_factor = atof(value);
} else if (strcmp(key, "tablet_map_to_mon") == 0) {
if (config->tablet_map_to_mon)
free(config->tablet_map_to_mon);
config->tablet_map_to_mon = strdup(value);
} else if (strcmp(key, "trackpad_scroll_factor") == 0) {
config->trackpad_scroll_factor = atof(value);
} else if (strcmp(key, "gappih") == 0) {
@ -3082,6 +3089,11 @@ void free_config(void) {
config.cursor_theme = NULL;
}
if (config.tablet_map_to_mon) {
free(config.tablet_map_to_mon);
config.tablet_map_to_mon = NULL;
}
// 释放 circle_layout
free_circle_layout(&config);
@ -3499,6 +3511,7 @@ bool parse_config(void) {
config.tag_rules = NULL;
config.tag_rules_count = 0;
config.cursor_theme = NULL;
config.tablet_map_to_mon = NULL;
strcpy(config.keymode, "default");
create_config_keymap();