aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/input
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 11:32:07 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-20 11:34:57 -0500
commit9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf (patch)
tree1417f4b913875db24efc5418481ab057679680cd /sway/commands/input
parentMerge pull request #1571 from acrisci/wlroots-modifiers-update (diff)
downloadsway-9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf.tar.gz
sway-9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf.tar.zst
sway-9e0595f26bcca2a4d0aa735c4cd9fc4f792918bf.zip
input config handler context
Diffstat (limited to 'sway/commands/input')
-rw-r--r--sway/commands/input/accel_profile.c2
-rw-r--r--sway/commands/input/click_method.c4
-rw-r--r--sway/commands/input/drag_lock.c2
-rw-r--r--sway/commands/input/dwt.c2
-rw-r--r--sway/commands/input/events.c6
-rw-r--r--sway/commands/input/left_handed.c2
-rw-r--r--sway/commands/input/middle_emulation.c2
-rw-r--r--sway/commands/input/natural_scroll.c2
-rw-r--r--sway/commands/input/pointer_accel.c2
-rw-r--r--sway/commands/input/scroll_method.c2
-rw-r--r--sway/commands/input/tap.c3
-rw-r--r--sway/commands/input/xkb_layout.c3
-rw-r--r--sway/commands/input/xkb_model.c3
-rw-r--r--sway/commands/input/xkb_options.c3
-rw-r--r--sway/commands/input/xkb_rules.c3
-rw-r--r--sway/commands/input/xkb_variant.c3
16 files changed, 34 insertions, 10 deletions
diff --git a/sway/commands/input/accel_profile.c b/sway/commands/input/accel_profile.c
index f72b7d48..37d6e133 100644
--- a/sway/commands/input/accel_profile.c
+++ b/sway/commands/input/accel_profile.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_accel_profile(int argc, char **argv) {
9 if ((error = checkarg(argc, "accel_profile", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "accel_profile", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, "accel_profile", 15 return cmd_results_new(CMD_FAILURE, "accel_profile",
14 "No input device defined."); 16 "No input device defined.");
diff --git a/sway/commands/input/click_method.c b/sway/commands/input/click_method.c
index 22eb15f7..8f1f0aa7 100644
--- a/sway/commands/input/click_method.c
+++ b/sway/commands/input/click_method.c
@@ -6,12 +6,12 @@
6#include "log.h" 6#include "log.h"
7 7
8struct cmd_results *input_cmd_click_method(int argc, char **argv) { 8struct cmd_results *input_cmd_click_method(int argc, char **argv) {
9 wlr_log(L_DEBUG, "click_method for device: %d %s",
10 current_input_config==NULL, current_input_config->identifier);
11 struct cmd_results *error = NULL; 9 struct cmd_results *error = NULL;
12 if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) { 10 if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) {
13 return error; 11 return error;
14 } 12 }
13 struct input_config *current_input_config =
14 config->handler_context.input_config;
15 if (!current_input_config) { 15 if (!current_input_config) {
16 return cmd_results_new(CMD_FAILURE, "click_method", 16 return cmd_results_new(CMD_FAILURE, "click_method",
17 "No input device defined."); 17 "No input device defined.");
diff --git a/sway/commands/input/drag_lock.c b/sway/commands/input/drag_lock.c
index 1783978a..8273a7d4 100644
--- a/sway/commands/input/drag_lock.c
+++ b/sway/commands/input/drag_lock.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_drag_lock(int argc, char **argv) {
9 if ((error = checkarg(argc, "drag_lock", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "drag_lock", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, 15 return cmd_results_new(CMD_FAILURE,
14 "drag_lock", "No input device defined."); 16 "drag_lock", "No input device defined.");
diff --git a/sway/commands/input/dwt.c b/sway/commands/input/dwt.c
index 8108a110..995a2f47 100644
--- a/sway/commands/input/dwt.c
+++ b/sway/commands/input/dwt.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_dwt(int argc, char **argv) {
9 if ((error = checkarg(argc, "dwt", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "dwt", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, "dwt", "No input device defined."); 15 return cmd_results_new(CMD_FAILURE, "dwt", "No input device defined.");
14 } 16 }
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c
index a1bfbacd..2217f5ce 100644
--- a/sway/commands/input/events.c
+++ b/sway/commands/input/events.c
@@ -6,16 +6,18 @@
6#include "log.h" 6#include "log.h"
7 7
8struct cmd_results *input_cmd_events(int argc, char **argv) { 8struct cmd_results *input_cmd_events(int argc, char **argv) {
9 wlr_log(L_DEBUG, "events for device: %s",
10 current_input_config->identifier);
11 struct cmd_results *error = NULL; 9 struct cmd_results *error = NULL;
12 if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) { 10 if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) {
13 return error; 11 return error;
14 } 12 }
13 struct input_config *current_input_config =
14 config->handler_context.input_config;
15 if (!current_input_config) { 15 if (!current_input_config) {
16 return cmd_results_new(CMD_FAILURE, "events", 16 return cmd_results_new(CMD_FAILURE, "events",
17 "No input device defined."); 17 "No input device defined.");
18 } 18 }
19 wlr_log(L_DEBUG, "events for device: %s",
20 current_input_config->identifier);
19 struct input_config *new_config = 21 struct input_config *new_config =
20 new_input_config(current_input_config->identifier); 22 new_input_config(current_input_config->identifier);
21 23
diff --git a/sway/commands/input/left_handed.c b/sway/commands/input/left_handed.c
index 35740df3..94b8e03e 100644
--- a/sway/commands/input/left_handed.c
+++ b/sway/commands/input/left_handed.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_left_handed(int argc, char **argv) {
9 if ((error = checkarg(argc, "left_handed", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "left_handed", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, "left_handed", 15 return cmd_results_new(CMD_FAILURE, "left_handed",
14 "No input device defined."); 16 "No input device defined.");
diff --git a/sway/commands/input/middle_emulation.c b/sway/commands/input/middle_emulation.c
index 7bc08ae6..a551fd51 100644
--- a/sway/commands/input/middle_emulation.c
+++ b/sway/commands/input/middle_emulation.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) {
9 if ((error = checkarg(argc, "middle_emulation", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "middle_emulation", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, "middle_emulation", 15 return cmd_results_new(CMD_FAILURE, "middle_emulation",
14 "No input device defined."); 16 "No input device defined.");
diff --git a/sway/commands/input/natural_scroll.c b/sway/commands/input/natural_scroll.c
index a7dcdc2c..c4e19b78 100644
--- a/sway/commands/input/natural_scroll.c
+++ b/sway/commands/input/natural_scroll.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_natural_scroll(int argc, char **argv) {
9 if ((error = checkarg(argc, "natural_scroll", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "natural_scroll", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, "natural_scoll", 15 return cmd_results_new(CMD_FAILURE, "natural_scoll",
14 "No input device defined."); 16 "No input device defined.");
diff --git a/sway/commands/input/pointer_accel.c b/sway/commands/input/pointer_accel.c
index d2261a63..171063aa 100644
--- a/sway/commands/input/pointer_accel.c
+++ b/sway/commands/input/pointer_accel.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_pointer_accel(int argc, char **argv) {
9 if ((error = checkarg(argc, "pointer_accel", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "pointer_accel", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, 15 return cmd_results_new(CMD_FAILURE,
14 "pointer_accel", "No input device defined."); 16 "pointer_accel", "No input device defined.");
diff --git a/sway/commands/input/scroll_method.c b/sway/commands/input/scroll_method.c
index 035262cf..0a1c57ac 100644
--- a/sway/commands/input/scroll_method.c
+++ b/sway/commands/input/scroll_method.c
@@ -9,6 +9,8 @@ struct cmd_results *input_cmd_scroll_method(int argc, char **argv) {
9 if ((error = checkarg(argc, "scroll_method", EXPECTED_AT_LEAST, 1))) { 9 if ((error = checkarg(argc, "scroll_method", EXPECTED_AT_LEAST, 1))) {
10 return error; 10 return error;
11 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
12 if (!current_input_config) { 14 if (!current_input_config) {
13 return cmd_results_new(CMD_FAILURE, "scroll_method", 15 return cmd_results_new(CMD_FAILURE, "scroll_method",
14 "No input device defined."); 16 "No input device defined.");
diff --git a/sway/commands/input/tap.c b/sway/commands/input/tap.c
index ecab9a5b..e7f03058 100644
--- a/sway/commands/input/tap.c
+++ b/sway/commands/input/tap.c
@@ -6,11 +6,12 @@
6#include "log.h" 6#include "log.h"
7 7
8struct cmd_results *input_cmd_tap(int argc, char **argv) { 8struct cmd_results *input_cmd_tap(int argc, char **argv) {
9 wlr_log(L_DEBUG, "tap for device: %s", current_input_config->identifier);
10 struct cmd_results *error = NULL; 9 struct cmd_results *error = NULL;
11 if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) { 10 if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) {
12 return error; 11 return error;
13 } 12 }
13 struct input_config *current_input_config =
14 config->handler_context.input_config;
14 if (!current_input_config) { 15 if (!current_input_config) {
15 return cmd_results_new(CMD_FAILURE, "tap", "No input device defined."); 16 return cmd_results_new(CMD_FAILURE, "tap", "No input device defined.");
16 } 17 }
diff --git a/sway/commands/input/xkb_layout.c b/sway/commands/input/xkb_layout.c
index 25db1a33..867e65d3 100644
--- a/sway/commands/input/xkb_layout.c
+++ b/sway/commands/input/xkb_layout.c
@@ -5,11 +5,12 @@
5#include "log.h" 5#include "log.h"
6 6
7struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) { 7struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
8 wlr_log(L_DEBUG, "xkb layout for device: %s", current_input_config->identifier);
9 struct cmd_results *error = NULL; 8 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "xkb_layout", EXPECTED_EQUAL_TO, 1))) { 9 if ((error = checkarg(argc, "xkb_layout", EXPECTED_EQUAL_TO, 1))) {
11 return error; 10 return error;
12 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
13 if (!current_input_config) { 14 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "xkb_layout", "No input device defined."); 15 return cmd_results_new(CMD_FAILURE, "xkb_layout", "No input device defined.");
15 } 16 }
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c
index 819b796b..e8c8e04e 100644
--- a/sway/commands/input/xkb_model.c
+++ b/sway/commands/input/xkb_model.c
@@ -5,11 +5,12 @@
5#include "log.h" 5#include "log.h"
6 6
7struct cmd_results *input_cmd_xkb_model(int argc, char **argv) { 7struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
8 wlr_log(L_DEBUG, "xkb model for device: %s", current_input_config->identifier);
9 struct cmd_results *error = NULL; 8 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) { 9 if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) {
11 return error; 10 return error;
12 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
13 if (!current_input_config) { 14 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "xkb_model", "No input device defined."); 15 return cmd_results_new(CMD_FAILURE, "xkb_model", "No input device defined.");
15 } 16 }
diff --git a/sway/commands/input/xkb_options.c b/sway/commands/input/xkb_options.c
index ff5f83ec..e9ddd6e3 100644
--- a/sway/commands/input/xkb_options.c
+++ b/sway/commands/input/xkb_options.c
@@ -5,11 +5,12 @@
5#include "log.h" 5#include "log.h"
6 6
7struct cmd_results *input_cmd_xkb_options(int argc, char **argv) { 7struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
8 wlr_log(L_DEBUG, "xkb options for device: %s", current_input_config->identifier);
9 struct cmd_results *error = NULL; 8 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) { 9 if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) {
11 return error; 10 return error;
12 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
13 if (!current_input_config) { 14 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "xkb_options", "No input device defined."); 15 return cmd_results_new(CMD_FAILURE, "xkb_options", "No input device defined.");
15 } 16 }
diff --git a/sway/commands/input/xkb_rules.c b/sway/commands/input/xkb_rules.c
index aafe0003..926d0ac1 100644
--- a/sway/commands/input/xkb_rules.c
+++ b/sway/commands/input/xkb_rules.c
@@ -5,11 +5,12 @@
5#include "log.h" 5#include "log.h"
6 6
7struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) { 7struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
8 wlr_log(L_DEBUG, "xkb rules for device: %s", current_input_config->identifier);
9 struct cmd_results *error = NULL; 8 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) { 9 if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) {
11 return error; 10 return error;
12 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
13 if (!current_input_config) { 14 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "xkb_rules", "No input device defined."); 15 return cmd_results_new(CMD_FAILURE, "xkb_rules", "No input device defined.");
15 } 16 }
diff --git a/sway/commands/input/xkb_variant.c b/sway/commands/input/xkb_variant.c
index 89a61fdc..0e3ffd41 100644
--- a/sway/commands/input/xkb_variant.c
+++ b/sway/commands/input/xkb_variant.c
@@ -5,11 +5,12 @@
5#include "log.h" 5#include "log.h"
6 6
7struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) { 7struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
8 wlr_log(L_DEBUG, "xkb variant for device: %s", current_input_config->identifier);
9 struct cmd_results *error = NULL; 8 struct cmd_results *error = NULL;
10 if ((error = checkarg(argc, "xkb_variant", EXPECTED_EQUAL_TO, 1))) { 9 if ((error = checkarg(argc, "xkb_variant", EXPECTED_EQUAL_TO, 1))) {
11 return error; 10 return error;
12 } 11 }
12 struct input_config *current_input_config =
13 config->handler_context.input_config;
13 if (!current_input_config) { 14 if (!current_input_config) {
14 return cmd_results_new(CMD_FAILURE, "xkb_variant", "No input device defined."); 15 return cmd_results_new(CMD_FAILURE, "xkb_variant", "No input device defined.");
15 } 16 }