aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/input/pointer_accel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/input/pointer_accel.c')
-rw-r--r--sway/commands/input/pointer_accel.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sway/commands/input/pointer_accel.c b/sway/commands/input/pointer_accel.c
index efd81ee6..e214b32f 100644
--- a/sway/commands/input/pointer_accel.c
+++ b/sway/commands/input/pointer_accel.c
@@ -13,19 +13,17 @@ struct cmd_results *input_cmd_pointer_accel(int argc, char **argv) {
13 } 13 }
14 struct input_config *ic = config->handler_context.input_config; 14 struct input_config *ic = config->handler_context.input_config;
15 if (!ic) { 15 if (!ic) {
16 return cmd_results_new(CMD_FAILURE, 16 return cmd_results_new(CMD_FAILURE, "No input device defined.");
17 "pointer_accel", "No input device defined.");
18 } 17 }
19 18
20 float pointer_accel = parse_float(argv[0]); 19 float pointer_accel = parse_float(argv[0]);
21 if (isnan(pointer_accel)) { 20 if (isnan(pointer_accel)) {
22 return cmd_results_new(CMD_INVALID, "pointer_accel", 21 return cmd_results_new(CMD_INVALID,
23 "Invalid pointer accel; expected float."); 22 "Invalid pointer accel; expected float.");
24 } if (pointer_accel < -1 || pointer_accel > 1) { 23 } if (pointer_accel < -1 || pointer_accel > 1) {
25 return cmd_results_new(CMD_INVALID, "pointer_accel", 24 return cmd_results_new(CMD_INVALID, "Input out of range [-1, 1]");
26 "Input out of range [-1, 1]");
27 } 25 }
28 ic->pointer_accel = pointer_accel; 26 ic->pointer_accel = pointer_accel;
29 27
30 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 28 return cmd_results_new(CMD_SUCCESS, NULL);
31} 29}