Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.10: CI testing of patch queue #463

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions hid-xpadneo/src/hid-xpadneo.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,13 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
__set_bit(BTN_PADDLES(3), xdata->gamepad->keybit);
}

/* expose current profile as buttons */
__set_bit(BTN_PROFILES(0), xdata->gamepad->keybit);
__set_bit(BTN_PROFILES(1), xdata->gamepad->keybit);
__set_bit(BTN_PROFILES(2), xdata->gamepad->keybit);
__set_bit(BTN_PROFILES(3), xdata->gamepad->keybit);
input_report_key(xdata->gamepad, BTN_PROFILES(0), 1);

return 0;
}

Expand Down Expand Up @@ -1026,6 +1033,14 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
}

stop_processing:
/* report the profile change */
if (xdata->last_profile != xdata->profile) {
if (xdata->last_profile < 4)
input_report_key(gamepad, BTN_PROFILES(xdata->last_profile), 0);
input_report_key(gamepad, BTN_PROFILES(xdata->profile), 1);
xdata->last_profile = xdata->profile;
}

return 1;
}

Expand Down
9 changes: 5 additions & 4 deletions hid-xpadneo/src/xpadneo.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ do { \
} while (0)

/* button aliases */
#define BTN_PADDLES(b) (BTN_TRIGGER_HAPPY5+(b))
#define BTN_SHARE KEY_F12
#define BTN_XBOX BTN_MODE
#define BTN_PROFILES(b) (BTN_TRIGGER_HAPPY33+(b))
#define BTN_PADDLES(b) (BTN_TRIGGER_HAPPY5+(b))
#define BTN_SHARE KEY_F12
#define BTN_XBOX BTN_MODE

/* module parameter "trigger_rumble_mode" */
#define PARAM_TRIGGER_RUMBLE_PRESSURE 0
Expand Down Expand Up @@ -152,7 +153,7 @@ struct xpadneo_devdata {

/* profile switching */
bool xbox_button_down, profile_switched;
u8 profile;
u8 last_profile, profile;

/* mouse mode */
bool mouse_mode;
Expand Down