Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: atar-axis/xpadneo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c282b6ef4ade6066855154859a809af25c3dd844
Choose a base ref
..
head repository: atar-axis/xpadneo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3b8a2206e9840f22e1e8d35a1e547c12e21f0f78
Choose a head ref
Showing with 21 additions and 0 deletions.
  1. +18 −0 hid-xpadneo/src/hid-xpadneo.c
  2. +3 −0 hid-xpadneo/src/xpadneo.h
18 changes: 18 additions & 0 deletions hid-xpadneo/src/hid-xpadneo.c
Original file line number Diff line number Diff line change
@@ -747,6 +747,20 @@ static u8 *xpadneo_report_fixup(struct hid_device *hdev, u8 *rdesc, unsigned int
return rdesc;
}

static void xpadneo_toggle_mouse(struct xpadneo_devdata *xdata)
{
if (xdata->mouse_mode) {
xdata->mouse_mode = false;
hid_info(xdata->hdev, "mouse mode disabled\n");
} else {
xdata->mouse_mode = true;
hid_info(xdata->hdev, "mouse mode enabled\n");
}

/* Indicate that a request was made */
xdata->profile_switched = true;
}

static void xpadneo_switch_profile(struct xpadneo_devdata *xdata, const u8 profile,
const bool emulated)
{
@@ -1035,6 +1049,10 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
if (value == 1)
xpadneo_switch_profile(xdata, 3, true);
goto stop_processing;
case BTN_SELECT:
if (value == 1)
xpadneo_toggle_mouse(xdata);
goto stop_processing;
}
}
}
3 changes: 3 additions & 0 deletions hid-xpadneo/src/xpadneo.h
Original file line number Diff line number Diff line change
@@ -136,6 +136,9 @@ struct xpadneo_devdata {
bool xbox_button_down, profile_switched;
u8 profile;

/* mouse mode */
bool mouse_mode;

/* trigger scale */
struct {
u8 left, right;