aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-12 08:29:37 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-12 08:29:37 -0500
commit163edc5a900fda58e006ed30e14ae10cc4aa13b3 (patch)
treea43e355091da4545bf9f16c63accb7d853170195 /sway/config.c
parentinput config (diff)
downloadsway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.tar.gz
sway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.tar.zst
sway-163edc5a900fda58e006ed30e14ae10cc4aa13b3.zip
sway input device
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c
index ec8e89b4..7ae3c2a4 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -226,6 +226,34 @@ static int qstrcmp(const void* a, const void* b) {
226 return strcmp(*((char**) a), *((char**) b)); 226 return strcmp(*((char**) a), *((char**) b));
227} 227}
228 228
229struct input_config *new_input_config(const char* identifier) {
230 struct input_config *input = calloc(1, sizeof(struct input_config));
231 if (!input) {
232 sway_log(L_DEBUG, "Unable to allocate input config");
233 return NULL;
234 }
235 sway_log(L_DEBUG, "new_input_config(%s)", identifier);
236 if (!(input->identifier = strdup(identifier))) {
237 free(input);
238 sway_log(L_DEBUG, "Unable to allocate input config");
239 return NULL;
240 }
241
242 input->tap = INT_MIN;
243 input->drag_lock = INT_MIN;
244 input->dwt = INT_MIN;
245 input->send_events = INT_MIN;
246 input->click_method = INT_MIN;
247 input->middle_emulation = INT_MIN;
248 input->natural_scroll = INT_MIN;
249 input->accel_profile = INT_MIN;
250 input->pointer_accel = FLT_MIN;
251 input->scroll_method = INT_MIN;
252 input->left_handed = INT_MIN;
253
254 return input;
255}
256
229void merge_input_config(struct input_config *dst, struct input_config *src) { 257void merge_input_config(struct input_config *dst, struct input_config *src) {
230 if (src->identifier) { 258 if (src->identifier) {
231 if (dst->identifier) { 259 if (dst->identifier) {
@@ -453,6 +481,7 @@ bool load_include_configs(const char *path, struct sway_config *config) {
453 return true; 481 return true;
454} 482}
455 483
484
456bool read_config(FILE *file, struct sway_config *config) { 485bool read_config(FILE *file, struct sway_config *config) {
457 bool success = true; 486 bool success = true;
458 enum cmd_status block = CMD_BLOCK_END; 487 enum cmd_status block = CMD_BLOCK_END;