| summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/parameters/handle_remote_client_commands.c | 17 | ||||
| -rw-r--r-- | src/config/parameters/parameters.c | 10 | ||||
| -rw-r--r-- | src/device/axis/axis_filter.c | 5 | ||||
| -rw-r--r-- | src/device/axis/axis_option.c | 6 |
4 files changed, 32 insertions, 6 deletions
diff --git a/src/config/parameters/handle_remote_client_commands.c b/src/config/parameters/handle_remote_client_commands.c index caa82dc..95830c7 100644 --- a/src/config/parameters/handle_remote_client_commands.c +++ b/src/config/parameters/handle_remote_client_commands.c @@ -366,10 +366,27 @@ static int handle_option_toggle { parameters->axes[axis_name].flags[RELABSD_REAL_FUZZ] ^= 1; } + else if (RELABSD_STRING_EQUALS("invert", input->buffer)) + { + parameters->axes[axis_name].flags[RELABSD_INVERT] ^= 1; + } + else if (RELABSD_STRING_EQUALS("not_abs", input->buffer)) + { + parameters->axes[axis_name].flags[RELABSD_NOT_ABS] ^= 1; + } else if (RELABSD_STRING_EQUALS("enable", input->buffer)) { parameters->axes[axis_name].is_enabled ^= 1; } + else if (RELABSD_IS_PREFIX("convert_to=", input->buffer)) + { + relabsd_axis_enable_option_from_name + ( + input->buffer, + relabsd_axis_name_to_string(axis_name), + (parameters->axes + axis_name) + ); + } else { RELABSD_ERROR diff --git a/src/config/parameters/parameters.c b/src/config/parameters/parameters.c index cee6f2e..d9a3d46 100644 --- a/src/config/parameters/parameters.c +++ b/src/config/parameters/parameters.c @@ -320,7 +320,7 @@ int relabsd_parameters_parse_options RELABSD_STRING_EQUALS("-m", argv[i]) || RELABSD_STRING_EQUALS("--mod-axis", argv[i]) || RELABSD_STRING_EQUALS("-o", argv[i]) - || RELABSD_STRING_EQUALS("--toggle-argv[i]", argv[i]) + || RELABSD_STRING_EQUALS("--toggle-option", argv[i]) ||RELABSD_STRING_EQUALS("-q", argv[i]) || RELABSD_STRING_EQUALS("--quit", argv[i]) ) @@ -460,13 +460,13 @@ void relabsd_parameters_print_usage (const char exec [const restrict static 1]) "\t[-q | --quit]\n" "\t\tTerminates the targeted server instance.\n\n" - "\t[-m | --mod-axis] <axis_name> [min|max|fuzz|flat|resolution]" - " [+|-|=]<value>\n" + "\t[-m | --mod-axis] <axis_name> " + "[min|max|fuzz|flat|resolution] [+|-|=]<value>\n" "\t\tModifies an axis.\n\n" "\t[-o | --toggle-option] <axis_name> " - "[direct|real_fuzz|framed|enable|convert_to=<axis_name>]\n" - "\t\tToggles an axis option.\n", + "[direct|real_fuzz|framed|enable|invert|not_abs|convert_to=<axis_name>]\n" + "\t\tToggles or sets an axis option.\n", exec, exec, exec, diff --git a/src/device/axis/axis_filter.c b/src/device/axis/axis_filter.c index 6258ad9..d7840ca 100644 --- a/src/device/axis/axis_filter.c +++ b/src/device/axis/axis_filter.c @@ -122,6 +122,11 @@ int relabsd_axis_filter_new_value return 0; } + if (axis->flags[RELABSD_INVERT]) + { + *value = -(*value); + } + if (axis->flags[RELABSD_NOT_ABS]) { return 1; diff --git a/src/device/axis/axis_option.c b/src/device/axis/axis_option.c index 7796eb7..e8d06f5 100644 --- a/src/device/axis/axis_option.c +++ b/src/device/axis/axis_option.c @@ -57,10 +57,14 @@ int relabsd_axis_enable_option_from_name ); } } - else if (RELABSD_IS_PREFIX("notabs", option_name)) + else if (RELABSD_IS_PREFIX("not_abs", option_name)) { axis->flags[RELABSD_NOT_ABS] = 1; } + else if (RELABSD_IS_PREFIX("invert", option_name)) + { + axis->flags[RELABSD_INVERT] = 1; + } else if (RELABSD_IS_PREFIX("convert_to=", option_name)) { axis->convert_to = |


