diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 04c5fdb5..9913a78b 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -33,6 +33,10 @@ files in `/sys/module/hid_xpadneo/parameters`: * `16` if your controller boots in Linux mode (auto-detected, do not change manually) * `32` if you prefer to use Nintendo button mappings (i.e., 8BitDo controllers, defaults to off) * `64` if your controller has a awkwardly mapped Share button (auto-detected, do not set manually) +* 'disable_shift_mode' (default 0) + * Let's you disable Xbox logo button shift behavior + * '0' Xbox logo button will be used as shift + * '1' will pass through the Xbox logo button as is Some settings may need to be changed at loading time of the module, take a look at the following example to see how that works: diff --git a/docs/README.md b/docs/README.md index 1c62ef83..7f699618 100644 --- a/docs/README.md +++ b/docs/README.md @@ -217,6 +217,9 @@ or Y while holding down the Xbox logo button. However, the following caveats app - Full support will be available once the Xbox Elite Series 2 controller is fully supported. - If you hold the button for too long, the controller will turn off - we cannot prevent that. +**Important:** Emulated profile switching won't work if you disabled the shift-mode of the Xbox logo button (module +parameter `disable_shift_mode`). + ## Getting Started diff --git a/hid-xpadneo/src/hid-xpadneo.c b/hid-xpadneo/src/hid-xpadneo.c index 4e034cba..3ec206dc 100644 --- a/hid-xpadneo/src/hid-xpadneo.c +++ b/hid-xpadneo/src/hid-xpadneo.c @@ -52,6 +52,12 @@ MODULE_PARM_DESC(enable_rolling_axis, "(bool) Enable rolling axis by combining both triggers, out of spec for many games. (deprecated) " "0: disable, 1: enable."); +static bool param_disable_shift_mode = 0; +module_param_named(disable_shift_mode, param_disable_shift_mode, bool, 0644); +MODULE_PARM_DESC(disable_shift_mode, + "(bool) Disable use Xbox logo button as shift. Will prohibit profile switching when enabled. " + "0: disable, 1: enable."); + static struct { char *args[17]; unsigned int nargs; @@ -940,7 +946,8 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field, xdata->last_abs_rz = value; goto combine_z_axes; } - } else if ((usage->type == EV_KEY) && (usage->code == BTN_XBOX)) { + } else if (!param_disable_shift_mode && (usage->type == EV_KEY) + && (usage->code == BTN_XBOX)) { /* * Handle the Xbox logo button: We want to cache the button * down event to allow for profile switching. The button will