Skip to content

Commit

Permalink
added shift debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
atar-axis committed Dec 5, 2018
1 parent e266400 commit 92cb47d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions hid-xpadneo/src/hid-xpadneo.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ static int xpadneo_input_configured(struct hid_device *hdev,
input_set_abs_params(xdata->idev, ABS_RY, -32768, 32767, 255, 4095);

// furthermore, we need to translate the incoming events to fit within
// the new range
// the new range, we will do that in the xpadneo_event() hook.

return 0;
}
Expand Down Expand Up @@ -1077,6 +1077,7 @@ int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
input_report_key(idev, BTN_THUMBR, value);
break;
}
input_sync(idev);

hid_dbg_lvl(DBG_LVL_SOME, hdev,
"hid-upage: %02x, hid-usage: %02x fixed\n",
Expand All @@ -1090,13 +1091,17 @@ int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
// we have to shift the range of the analogues sticks (ABS_X/Y/RX/RY)
// as already explained in xpadneo_input_configured() above

switch (usage->code) {
case ABS_X:
case ABS_Y:
case ABS_RX:
case ABS_RY:
input_report_abs(idev, usage->code, value - 32768);
return EV_STOP_PROCESSING;
if (usage->type == EV_ABS) {
switch (usage->code) {
case ABS_X:
case ABS_Y:
case ABS_RX:
case ABS_RY:
hid_dbg_lvl(DBG_LVL_SOME, hdev, "shifted axis %02x, new value: %i\n", usage->code, value - 32768);
input_report_abs(idev, usage->code, value - 32768);
//input_sync(idev);
return EV_STOP_PROCESSING;
}
}


Expand Down

0 comments on commit 92cb47d

Please sign in to comment.