diff options
| author | CismonX <admin@cismon.net> | 2023-07-04 16:19:21 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-07-05 14:22:28 +0000 |
| commit | d2fcb5343f57c132abec9a21ad89d1505a32c47c (patch) | |
| tree | 2580765e5cb9d5c7470488c4f32acc50f09c3855 /config.c | |
| parent | changelog: fractional-scaling-v1 -> fractional-scale-v1 (diff) | |
input: add basic support for touchscreen input
Closes #517
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -2476,6 +2476,20 @@ parse_section_tweak(struct context *ctx) } static bool +parse_section_touch(struct context *ctx) { + struct config *conf = ctx->conf; + const char *key = ctx->key; + + if (strcmp(key, "long-press-delay") == 0) + return value_to_uint32(ctx, 10, &conf->touch.long_press_delay); + + else { + LOG_CONTEXTUAL_ERR("not a valid option: %s", key); + return false; + } +} + +static bool parse_key_value(char *kv, const char **section, const char **key, const char **value) { bool section_is_needed = section != NULL; @@ -2554,6 +2568,7 @@ enum section { SECTION_TEXT_BINDINGS, SECTION_ENVIRONMENT, SECTION_TWEAK, + SECTION_TOUCH, SECTION_COUNT, }; @@ -2579,6 +2594,7 @@ static const struct { [SECTION_TEXT_BINDINGS] = {&parse_section_text_bindings, "text-bindings"}, [SECTION_ENVIRONMENT] = {&parse_section_environment, "environment"}, [SECTION_TWEAK] = {&parse_section_tweak, "tweak"}, + [SECTION_TOUCH] = {&parse_section_touch, "touch"}, }; static_assert(ALEN(section_info) == SECTION_COUNT, "section info array size mismatch"); @@ -3026,6 +3042,10 @@ config_load(struct config *conf, const char *conf_path, .sixel = true, }, + .touch = { + .long_press_delay = 400, + }, + .env_vars = tll_init(), #if defined(UTMP_DEFAULT_HELPER_PATH) .utmp_helper_path = ((strlen(UTMP_DEFAULT_HELPER_PATH) > 0 && |
