Skip to content

Commit f61508f

Browse files
BoukeHaarsma23kakra
andcommitted
xpadneo, core: Add configuration for disabling Xbox logo shift-mode
For use with Steam, the `Guide`+`A` is mapped to the QAM. To not lose the profile switching behavior, let the user configure this. Co-authored-by: Kai Krakow <kai@kaishome.de> Fixes: atar-axis#419 Closes: atar-axis#435 Fixes: atar-axis#454 Signed-off-by: Kai Krakow <kai@kaishome.de>
1 parent abe3275 commit f61508f

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

docs/CONFIGURATION.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ files in `/sys/module/hid_xpadneo/parameters`:
3333
* `16` if your controller boots in Linux mode (auto-detected, do not change manually)
3434
* `32` if you prefer to use Nintendo button mappings (i.e., 8BitDo controllers, defaults to off)
3535
* `64` if your controller has a awkwardly mapped Share button (auto-detected, do not set manually)
36+
* 'disable_shift_mode' (default 0)
37+
* Let's you disable Xbox logo button shift behavior
38+
* '0' Xbox logo button will be used as shift
39+
* '1' will pass through the Xbox logo button as is
3640

3741
Some settings may need to be changed at loading time of the module, take a look at the following example to see how
3842
that works:

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ or Y while holding down the Xbox logo button. However, the following caveats app
217217
- Full support will be available once the Xbox Elite Series 2 controller is fully supported.
218218
- If you hold the button for too long, the controller will turn off - we cannot prevent that.
219219

220+
**Important:** Emulated profile switching won't work if you disabled the shift-mode of the Xbox logo button (module
221+
parameter `disable_shift_mode`).
222+
220223

221224
## Getting Started
222225

hid-xpadneo/src/hid-xpadneo.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ MODULE_PARM_DESC(enable_rolling_axis,
5252
"(bool) Enable rolling axis by combining both triggers, out of spec for many games. (deprecated) "
5353
"0: disable, 1: enable.");
5454

55+
static bool param_disable_shift_mode = 0;
56+
module_param_named(disable_shift_mode, param_disable_shift_mode, bool, 0644);
57+
MODULE_PARM_DESC(disable_shift_mode,
58+
"(bool) Disable use Xbox logo button as shift. Will prohibit profile switching when enabled. "
59+
"0: disable, 1: enable.");
60+
5561
static struct {
5662
char *args[17];
5763
unsigned int nargs;
@@ -947,7 +953,8 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
947953
xdata->last_abs_rz = value;
948954
goto combine_z_axes;
949955
}
950-
} else if ((usage->type == EV_KEY) && (usage->code == BTN_XBOX)) {
956+
} else if (!param_disable_shift_mode && (usage->type == EV_KEY)
957+
&& (usage->code == BTN_XBOX)) {
951958
/*
952959
* Handle the Xbox logo button: We want to cache the button
953960
* down event to allow for profile switching. The button will

0 commit comments

Comments
 (0)