mirror of
https://github.com/swaywm/sway.git
synced 2026-03-04 01:41:11 -05:00
input config handler context
This commit is contained in:
parent
3dd915876d
commit
9e0595f26b
21 changed files with 69 additions and 25 deletions
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_accel_profile(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "accel_profile", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "accel_profile",
|
||||
"No input device defined.");
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_click_method(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "click_method for device: %d %s",
|
||||
current_input_config==NULL, current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "click_method",
|
||||
"No input device defined.");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_drag_lock(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "drag_lock", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE,
|
||||
"drag_lock", "No input device defined.");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_dwt(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "dwt", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "dwt", "No input device defined.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,16 +6,18 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_events(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "events for device: %s",
|
||||
current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "events",
|
||||
"No input device defined.");
|
||||
}
|
||||
wlr_log(L_DEBUG, "events for device: %s",
|
||||
current_input_config->identifier);
|
||||
struct input_config *new_config =
|
||||
new_input_config(current_input_config->identifier);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_left_handed(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "left_handed", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "left_handed",
|
||||
"No input device defined.");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "middle_emulation", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "middle_emulation",
|
||||
"No input device defined.");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_natural_scroll(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "natural_scroll", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "natural_scoll",
|
||||
"No input device defined.");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_pointer_accel(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "pointer_accel", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE,
|
||||
"pointer_accel", "No input device defined.");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct cmd_results *input_cmd_scroll_method(int argc, char **argv) {
|
|||
if ((error = checkarg(argc, "scroll_method", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "scroll_method",
|
||||
"No input device defined.");
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_tap(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "tap for device: %s", current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "tap", "No input device defined.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "xkb layout for device: %s", current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "xkb_layout", EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "xkb_layout", "No input device defined.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "xkb model for device: %s", current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "xkb_model", "No input device defined.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "xkb options for device: %s", current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "xkb_options", "No input device defined.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "xkb rules for device: %s", current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "xkb_rules", "No input device defined.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
#include "log.h"
|
||||
|
||||
struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
|
||||
wlr_log(L_DEBUG, "xkb variant for device: %s", current_input_config->identifier);
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "xkb_variant", EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
struct input_config *current_input_config =
|
||||
config->handler_context.input_config;
|
||||
if (!current_input_config) {
|
||||
return cmd_results_new(CMD_FAILURE, "xkb_variant", "No input device defined.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue