Skip to content

Commit d1cd33e

Browse files
committed
xpadneo, consumer: Move buttons to keyboard device
Signed-off-by: Kai Krakow <kai@kaishome.de>
1 parent 262c56b commit d1cd33e

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

hid-xpadneo/src/hid-xpadneo.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h
865865
/* combine triggers to form a rudder, use ABS_MISC to order after dpad */
866866
input_set_abs_params(xdata->gamepad, ABS_MISC, -1023, 1023, 3, 63);
867867

868-
/* do not report the consumer control buttons as part of the gamepad */
868+
/* do not report the keyboard buttons as part of the gamepad */
869869
__clear_bit(BTN_SHARE, xdata->gamepad->keybit);
870870

871871
/* add paddles as part of the gamepad */
@@ -882,7 +882,7 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
882882
{
883883
struct xpadneo_devdata *xdata = hid_get_drvdata(hdev);
884884
struct input_dev *gamepad = xdata->gamepad;
885-
struct input_dev *consumer = xdata->consumer;
885+
struct input_dev *keyboard = xdata->keyboard;
886886

887887
if ((usage->type == EV_KEY) && (usage->code == BTN_PADDLES(0))) {
888888
if (gamepad && xdata->profile == 0) {
@@ -938,11 +938,11 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
938938
}
939939
goto stop_processing;
940940
} else if ((usage->type == EV_KEY) && (usage->code == BTN_SHARE)) {
941-
/* move the Share button to the consumer control device */
942-
if (!consumer)
943-
goto consumer_missing;
944-
input_report_key(consumer, BTN_SHARE, value);
945-
input_sync(consumer);
941+
/* move the Share button to the keyboard device */
942+
if (!keyboard)
943+
goto keyboard_missing;
944+
input_report_key(keyboard, BTN_SHARE, value);
945+
input_sync(keyboard);
946946
goto stop_processing;
947947
} else if (xdata->xbox_button_down && (usage->type == EV_KEY)) {
948948
if (!(xdata->quirks & XPADNEO_QUIRK_USE_HW_PROFILES)) {
@@ -981,10 +981,10 @@ static int xpadneo_event(struct hid_device *hdev, struct hid_field *field,
981981
}
982982
return 0;
983983

984-
consumer_missing:
985-
if ((xdata->missing_reported && XPADNEO_MISSING_CONSUMER) == 0) {
986-
xdata->missing_reported |= XPADNEO_MISSING_CONSUMER;
987-
hid_err(hdev, "consumer control not detected\n");
984+
keyboard_missing:
985+
if ((xdata->missing_reported && XPADNEO_MISSING_KEYBOARD) == 0) {
986+
xdata->missing_reported |= XPADNEO_MISSING_KEYBOARD;
987+
hid_err(hdev, "keyboard not detected\n");
988988
}
989989

990990
stop_processing:

hid-xpadneo/src/xpadneo/consumer.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ extern int xpadneo_init_consumer(struct xpadneo_devdata *xdata)
1818
return ret;
1919
}
2020

21-
/* enable key events for consumer control */
22-
input_set_capability(xdata->consumer, EV_KEY, BTN_SHARE);
23-
2421
if (synth) {
2522
ret = input_register_device(xdata->consumer);
2623
if (ret) {

hid-xpadneo/src/xpadneo/keyboard.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ extern int xpadneo_init_keyboard(struct xpadneo_devdata *xdata)
1818
return ret;
1919
}
2020

21+
/* enable key events for keyboard */
22+
input_set_capability(xdata->keyboard, EV_KEY, BTN_SHARE);
23+
2124
if (synth) {
2225
ret = input_register_device(xdata->keyboard);
2326
if (ret) {

0 commit comments

Comments
 (0)