diff options
author | 2017-12-12 09:02:30 -0500 | |
---|---|---|
committer | 2017-12-12 09:03:58 -0500 | |
commit | 538903bc5ace56c1dab0f5287fb4d0bab78a0165 (patch) | |
tree | d45d08f64e98a76c730145cf3ea75dd199d9f6c8 /sway/commands/input/middle_emulation.c | |
parent | sway input device (diff) | |
download | sway-538903bc5ace56c1dab0f5287fb4d0bab78a0165.tar.gz sway-538903bc5ace56c1dab0f5287fb4d0bab78a0165.tar.zst sway-538903bc5ace56c1dab0f5287fb4d0bab78a0165.zip |
config cleanup
Diffstat (limited to 'sway/commands/input/middle_emulation.c')
-rw-r--r-- | sway/commands/input/middle_emulation.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sway/commands/input/middle_emulation.c b/sway/commands/input/middle_emulation.c index d31ce950..e19964d8 100644 --- a/sway/commands/input/middle_emulation.c +++ b/sway/commands/input/middle_emulation.c | |||
@@ -9,16 +9,20 @@ struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) { | |||
9 | return error; | 9 | return error; |
10 | } | 10 | } |
11 | if (!current_input_config) { | 11 | if (!current_input_config) { |
12 | return cmd_results_new(CMD_FAILURE, "middle_emulation", "No input device defined."); | 12 | return cmd_results_new(CMD_FAILURE, "middle_emulation", |
13 | "No input device defined."); | ||
13 | } | 14 | } |
14 | struct input_config *new_config = new_input_config(current_input_config->identifier); | 15 | struct input_config *new_config = |
16 | new_input_config(current_input_config->identifier); | ||
15 | 17 | ||
16 | if (strcasecmp(argv[0], "enabled") == 0) { | 18 | if (strcasecmp(argv[0], "enabled") == 0) { |
17 | new_config->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED; | 19 | new_config->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED; |
18 | } else if (strcasecmp(argv[0], "disabled") == 0) { | 20 | } else if (strcasecmp(argv[0], "disabled") == 0) { |
19 | new_config->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED; | 21 | new_config->middle_emulation = |
22 | LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED; | ||
20 | } else { | 23 | } else { |
21 | return cmd_results_new(CMD_INVALID, "middle_emulation", "Expected 'middle_emulation <enabled|disabled>'"); | 24 | return cmd_results_new(CMD_INVALID, "middle_emulation", |
25 | "Expected 'middle_emulation <enabled|disabled>'"); | ||
22 | } | 26 | } |
23 | 27 | ||
24 | input_cmd_apply(new_config); | 28 | input_cmd_apply(new_config); |