diff --git a/hid-xpadneo/src/hid-xpadneo.c b/hid-xpadneo/src/hid-xpadneo.c index 6ce90406..14919275 100644 --- a/hid-xpadneo/src/hid-xpadneo.c +++ b/hid-xpadneo/src/hid-xpadneo.c @@ -865,7 +865,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h /* combine triggers to form a rudder, use ABS_MISC to order after dpad */ input_set_abs_params(xdata->gamepad, ABS_MISC, -1023, 1023, 3, 63); - /* do not report the consumer control buttons as part of the gamepad */ + /* do not report the keyboard buttons as part of the gamepad */ __clear_bit(BTN_XBOX, xdata->gamepad->keybit); __clear_bit(BTN_SHARE, xdata->gamepad->keybit); @@ -884,7 +884,7 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field, { struct xpadneo_devdata *xdata = hid_get_drvdata(hdev); struct input_dev *gamepad = xdata->gamepad; - struct input_dev *consumer = xdata->consumer; + struct input_dev *keyboard = xdata->keyboard; if ((usage->type == EV_KEY) && (usage->code == BTN_PADDLES(0))) { if (gamepad && xdata->profile == 0) { @@ -929,24 +929,24 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field, xdata->xbox_button_down = false; if (xdata->profile_switched) { xdata->profile_switched = false; - } else if (consumer) { + } else if (keyboard) { /* replay cached event */ - input_report_key(consumer, BTN_XBOX, 1); - input_sync(consumer); + input_report_key(keyboard, BTN_XBOX, 1); + input_sync(keyboard); /* synthesize the release to remove the scan code */ - input_report_key(consumer, BTN_XBOX, 0); - input_sync(consumer); + input_report_key(keyboard, BTN_XBOX, 0); + input_sync(keyboard); } } - if (!consumer) - goto consumer_missing; + if (!keyboard) + goto keyboard_missing; goto stop_processing; } else if ((usage->type == EV_KEY) && (usage->code == BTN_SHARE)) { - /* move the Share button to the consumer control device */ - if (!consumer) - goto consumer_missing; - input_report_key(consumer, BTN_SHARE, value); - input_sync(consumer); + /* move the Share button to the keyboard device */ + if (!keyboard) + goto keyboard_missing; + input_report_key(keyboard, BTN_SHARE, value); + input_sync(keyboard); goto stop_processing; } else if (xdata->xbox_button_down && (usage->type == EV_KEY)) { if (!(xdata->quirks & XPADNEO_QUIRK_USE_HW_PROFILES)) { @@ -985,10 +985,10 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field, } return 0; -consumer_missing: - if ((xdata->missing_reported && XPADNEO_MISSING_CONSUMER) == 0) { - xdata->missing_reported |= XPADNEO_MISSING_CONSUMER; - hid_err(hdev, "consumer control not detected\n"); +keyboard_missing: + if ((xdata->missing_reported && XPADNEO_MISSING_KEYBOARD) == 0) { + xdata->missing_reported |= XPADNEO_MISSING_KEYBOARD; + hid_err(hdev, "keyboard not detected\n"); } stop_processing: diff --git a/hid-xpadneo/src/xpadneo/consumer.c b/hid-xpadneo/src/xpadneo/consumer.c index cc33b3b4..95c1818c 100644 --- a/hid-xpadneo/src/xpadneo/consumer.c +++ b/hid-xpadneo/src/xpadneo/consumer.c @@ -18,10 +18,6 @@ extern int xpadneo_init_consumer(struct xpadneo_devdata *xdata) return ret; } - /* enable key events for consumer control */ - input_set_capability(xdata->consumer, EV_KEY, BTN_XBOX); - input_set_capability(xdata->consumer, EV_KEY, BTN_SHARE); - if (synth) { ret = input_register_device(xdata->consumer); if (ret) { diff --git a/hid-xpadneo/src/xpadneo/keyboard.c b/hid-xpadneo/src/xpadneo/keyboard.c index 28e8c39b..61fa2cde 100644 --- a/hid-xpadneo/src/xpadneo/keyboard.c +++ b/hid-xpadneo/src/xpadneo/keyboard.c @@ -18,6 +18,10 @@ extern int xpadneo_init_keyboard(struct xpadneo_devdata *xdata) return ret; } + /* enable key events for keyboard */ + input_set_capability(xdata->keyboard, EV_KEY, BTN_XBOX); + input_set_capability(xdata->keyboard, EV_KEY, BTN_SHARE); + if (synth) { ret = input_register_device(xdata->keyboard); if (ret) {