Skip to content

Commit 4d70f10

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: #419 Closes: #435 Fixes: #454 Signed-off-by: Kai Krakow <kai@kaishome.de>
1 parent 6ec1db8 commit 4d70f10

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
@@ -198,6 +198,9 @@ or Y while holding down the Xbox logo button. However, the following caveats app
198198
- Full support will be available once the Xbox Elite Series 2 controller is fully supported.
199199
- If you hold the button for too long, the controller will turn off - we cannot prevent that.
200200

201+
**Important:** Emulated profile switching won't work if you disabled the shift-mode of the Xbox logo button (module
202+
parameter `disable_shift_mode`).
203+
201204

202205
## Getting Started
203206

hid-xpadneo/src/hid-xpadneo.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ MODULE_PARM_DESC(disable_deadzones,
4747
"(bool) Disable dead zone handling for raw processing by Wine/Proton, confuses joydev. "
4848
"0: disable, 1: enable.");
4949

50+
static bool param_disable_shift_mode = 0;
51+
module_param_named(disable_shift_mode, param_disable_shift_mode, bool, 0644);
52+
MODULE_PARM_DESC(disable_shift_mode,
53+
"(bool) Disable use Xbox logo button as shift. Will prohibit profile switching when enabled. "
54+
"0: disable, 1: enable.");
55+
5056
static struct {
5157
char *args[17];
5258
unsigned int nargs;
@@ -964,7 +970,8 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
964970
xdata->last_abs_rz = value;
965971
goto combine_z_axes;
966972
}
967-
} else if ((usage->type == EV_KEY) && (usage->code == BTN_XBOX)) {
973+
} else if (!param_disable_shift_mode && (usage->type == EV_KEY)
974+
&& (usage->code == BTN_XBOX)) {
968975
/*
969976
* Handle the Xbox logo button: We want to cache the button
970977
* down event to allow for profile switching. The button will

0 commit comments

Comments
 (0)