summaryrefslogtreecommitdiffstats
path: root/sway/commands/input
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-11-18 11:22:02 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-11-18 11:22:02 -0500
commit733993a651c71f7e2198d505960d6bbd31e0e107 (patch)
treee51732c5872b624e73355f9e5b3f762101f3cd0d /sway/commands/input
parentInitial (awful) pass on xdg shell support (diff)
downloadsway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.gz
sway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.zst
sway-733993a651c71f7e2198d505960d6bbd31e0e107.zip
Move everything to sway/old/
Diffstat (limited to 'sway/commands/input')
-rw-r--r--sway/commands/input/accel_profile.c27
-rw-r--r--sway/commands/input/click_method.c30
-rw-r--r--sway/commands/input/drag_lock.c26
-rw-r--r--sway/commands/input/dwt.c26
-rw-r--r--sway/commands/input/events.c30
-rw-r--r--sway/commands/input/left_handed.c26
-rw-r--r--sway/commands/input/middle_emulation.c26
-rw-r--r--sway/commands/input/natural_scroll.c26
-rw-r--r--sway/commands/input/pointer_accel.c24
-rw-r--r--sway/commands/input/scroll_method.c30
-rw-r--r--sway/commands/input/tap.c29
11 files changed, 0 insertions, 300 deletions
diff --git a/sway/commands/input/accel_profile.c b/sway/commands/input/accel_profile.c
deleted file mode 100644
index 8288c1ad..00000000
--- a/sway/commands/input/accel_profile.c
+++ /dev/null
@@ -1,27 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_accel_profile(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "accel_profile", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "accel_profile", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 if (strcasecmp(argv[0], "adaptive") == 0) {
17 new_config->accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
18 } else if (strcasecmp(argv[0], "flat") == 0) {
19 new_config->accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
20 } else {
21 return cmd_results_new(CMD_INVALID, "accel_profile",
22 "Expected 'accel_profile <adaptive|flat>'");
23 }
24
25 input_cmd_apply(new_config);
26 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
27}
diff --git a/sway/commands/input/click_method.c b/sway/commands/input/click_method.c
deleted file mode 100644
index 5e9d3dcb..00000000
--- a/sway/commands/input/click_method.c
+++ /dev/null
@@ -1,30 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5#include "log.h"
6
7struct cmd_results *input_cmd_click_method(int argc, char **argv) {
8 sway_log(L_DEBUG, "click_method for device: %d %s", current_input_config==NULL, current_input_config->identifier);
9 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) {
11 return error;
12 }
13 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "click_method", "No input device defined.");
15 }
16 struct input_config *new_config = new_input_config(current_input_config->identifier);
17
18 if (strcasecmp(argv[0], "none") == 0) {
19 new_config->click_method = LIBINPUT_CONFIG_CLICK_METHOD_NONE;
20 } else if (strcasecmp(argv[0], "button_areas") == 0) {
21 new_config->click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
22 } else if (strcasecmp(argv[0], "clickfinger") == 0) {
23 new_config->click_method = LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
24 } else {
25 return cmd_results_new(CMD_INVALID, "click_method", "Expected 'click_method <none|button_areas|clickfinger'");
26 }
27
28 input_cmd_apply(new_config);
29 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
30}
diff --git a/sway/commands/input/drag_lock.c b/sway/commands/input/drag_lock.c
deleted file mode 100644
index f5a7beb4..00000000
--- a/sway/commands/input/drag_lock.c
+++ /dev/null
@@ -1,26 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_drag_lock(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "drag_lock", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "drag_lock", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 if (strcasecmp(argv[0], "enabled") == 0) {
17 new_config->drag_lock = LIBINPUT_CONFIG_DRAG_LOCK_ENABLED;
18 } else if (strcasecmp(argv[0], "disabled") == 0) {
19 new_config->drag_lock = LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
20 } else {
21 return cmd_results_new(CMD_INVALID, "drag_lock", "Expected 'drag_lock <enabled|disabled>'");
22 }
23
24 input_cmd_apply(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26}
diff --git a/sway/commands/input/dwt.c b/sway/commands/input/dwt.c
deleted file mode 100644
index 557b2207..00000000
--- a/sway/commands/input/dwt.c
+++ /dev/null
@@ -1,26 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_dwt(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "dwt", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "dwt", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 if (strcasecmp(argv[0], "enabled") == 0) {
17 new_config->dwt = LIBINPUT_CONFIG_DWT_ENABLED;
18 } else if (strcasecmp(argv[0], "disabled") == 0) {
19 new_config->dwt = LIBINPUT_CONFIG_DWT_DISABLED;
20 } else {
21 return cmd_results_new(CMD_INVALID, "dwt", "Expected 'dwt <enabled|disabled>'");
22 }
23
24 input_cmd_apply(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26}
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c
deleted file mode 100644
index 9d54287a..00000000
--- a/sway/commands/input/events.c
+++ /dev/null
@@ -1,30 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5#include "log.h"
6
7struct cmd_results *input_cmd_events(int argc, char **argv) {
8 sway_log(L_DEBUG, "events for device: %s", current_input_config->identifier);
9 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) {
11 return error;
12 }
13 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "events", "No input device defined.");
15 }
16 struct input_config *new_config = new_input_config(current_input_config->identifier);
17
18 if (strcasecmp(argv[0], "enabled") == 0) {
19 new_config->send_events = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
20 } else if (strcasecmp(argv[0], "disabled") == 0) {
21 new_config->send_events = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
22 } else if (strcasecmp(argv[0], "disabled_on_external_mouse") == 0) {
23 new_config->send_events = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
24 } else {
25 return cmd_results_new(CMD_INVALID, "events", "Expected 'events <enabled|disabled|disabled_on_external_mouse>'");
26 }
27
28 input_cmd_apply(new_config);
29 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
30}
diff --git a/sway/commands/input/left_handed.c b/sway/commands/input/left_handed.c
deleted file mode 100644
index 6c913e70..00000000
--- a/sway/commands/input/left_handed.c
+++ /dev/null
@@ -1,26 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_left_handed(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "left_handed", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "left_handed", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 if (strcasecmp(argv[0], "enabled") == 0) {
17 new_config->left_handed = 1;
18 } else if (strcasecmp(argv[0], "disabled") == 0) {
19 new_config->left_handed = 0;
20 } else {
21 return cmd_results_new(CMD_INVALID, "left_handed", "Expected 'left_handed <enabled|disabled>'");
22 }
23
24 input_cmd_apply(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26}
diff --git a/sway/commands/input/middle_emulation.c b/sway/commands/input/middle_emulation.c
deleted file mode 100644
index 33cdd7d6..00000000
--- a/sway/commands/input/middle_emulation.c
+++ /dev/null
@@ -1,26 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "middle_emulation", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "middle_emulation", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 if (strcasecmp(argv[0], "enabled") == 0) {
17 new_config->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED;
18 } else if (strcasecmp(argv[0], "disabled") == 0) {
19 new_config->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED;
20 } else {
21 return cmd_results_new(CMD_INVALID, "middle_emulation", "Expected 'middle_emulation <enabled|disabled>'");
22 }
23
24 input_cmd_apply(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26}
diff --git a/sway/commands/input/natural_scroll.c b/sway/commands/input/natural_scroll.c
deleted file mode 100644
index 7bc8b8d0..00000000
--- a/sway/commands/input/natural_scroll.c
+++ /dev/null
@@ -1,26 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_natural_scroll(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "natural_scroll", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "natural_scoll", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 if (strcasecmp(argv[0], "enabled") == 0) {
17 new_config->natural_scroll = 1;
18 } else if (strcasecmp(argv[0], "disabled") == 0) {
19 new_config->natural_scroll = 0;
20 } else {
21 return cmd_results_new(CMD_INVALID, "natural_scroll", "Expected 'natural_scroll <enabled|disabled>'");
22 }
23
24 input_cmd_apply(new_config);
25 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
26}
diff --git a/sway/commands/input/pointer_accel.c b/sway/commands/input/pointer_accel.c
deleted file mode 100644
index 94f595d1..00000000
--- a/sway/commands/input/pointer_accel.c
+++ /dev/null
@@ -1,24 +0,0 @@
1#include <stdlib.h>
2#include <string.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_pointer_accel(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "pointer_accel", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "pointer_accel", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 float pointer_accel = atof(argv[0]);
17 if (pointer_accel < -1 || pointer_accel > 1) {
18 return cmd_results_new(CMD_INVALID, "pointer_accel", "Input out of range [-1, 1]");
19 }
20 new_config->pointer_accel = pointer_accel;
21
22 input_cmd_apply(new_config);
23 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
24}
diff --git a/sway/commands/input/scroll_method.c b/sway/commands/input/scroll_method.c
deleted file mode 100644
index 5c6c3d7a..00000000
--- a/sway/commands/input/scroll_method.c
+++ /dev/null
@@ -1,30 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5
6struct cmd_results *input_cmd_scroll_method(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "scroll_method", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!current_input_config) {
12 return cmd_results_new(CMD_FAILURE, "scroll_method", "No input device defined.");
13 }
14 struct input_config *new_config = new_input_config(current_input_config->identifier);
15
16 if (strcasecmp(argv[0], "none") == 0) {
17 new_config->scroll_method = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
18 } else if (strcasecmp(argv[0], "two_finger") == 0) {
19 new_config->scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
20 } else if (strcasecmp(argv[0], "edge") == 0) {
21 new_config->scroll_method = LIBINPUT_CONFIG_SCROLL_EDGE;
22 } else if (strcasecmp(argv[0], "on_button_down") == 0) {
23 new_config->scroll_method = LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
24 } else {
25 return cmd_results_new(CMD_INVALID, "scroll_method", "Expected 'scroll_method <none|two_finger|edge|on_button_down>'");
26 }
27
28 input_cmd_apply(new_config);
29 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
30}
diff --git a/sway/commands/input/tap.c b/sway/commands/input/tap.c
deleted file mode 100644
index 9e3ca2af..00000000
--- a/sway/commands/input/tap.c
+++ /dev/null
@@ -1,29 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input.h"
5#include "log.h"
6
7struct cmd_results *input_cmd_tap(int argc, char **argv) {
8 sway_log(L_DEBUG, "tap for device: %s", current_input_config->identifier);
9 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) {
11 return error;
12 }
13 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "tap", "No input device defined.");
15 }
16 struct input_config *new_config = new_input_config(current_input_config->identifier);
17
18 if (strcasecmp(argv[0], "enabled") == 0) {
19 new_config->tap = LIBINPUT_CONFIG_TAP_ENABLED;
20 } else if (strcasecmp(argv[0], "disabled") == 0) {
21 new_config->tap = LIBINPUT_CONFIG_TAP_DISABLED;
22 } else {
23 return cmd_results_new(CMD_INVALID, "tap", "Expected 'tap <enabled|disabled>'");
24 }
25
26 sway_log(L_DEBUG, "apply-tap for device: %s", current_input_config->identifier);
27 input_cmd_apply(new_config);
28 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
29}