我目前正在尝试使用便宜的 Nintendo GameCube 控制器适配器用于 Wii U/Switch 和 PC(它有一个切换按钮,可以在控制台和计算机之间切换模式)(这个)在我的 Ubuntu 18.04 电脑上。
我已经发现此工具让它工作(在控制台模式下),但对我来说不起作用。插入时软件会确认,但什么也没发生,适配器上指示控制器已插入的指示灯不亮。
另一方面,当使用 PC 模式时,灯亮起并且运行sudo evtest
显示我的控制器作为一个事件(就此而言是事件 26);它的内容如下:
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x79 product 0x1846 version 0x110
Input device name: "Nintendo GameCube Controller Adapter"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event code 290 (BTN_THUMB2)
Event code 291 (BTN_TOP)
Event code 292 (BTN_TOP2)
Event code 293 (BTN_PINKIE)
Event code 294 (BTN_BASE)
Event code 295 (BTN_BASE2)
Event code 296 (BTN_BASE3)
Event code 297 (BTN_BASE4)
Event code 298 (BTN_BASE5)
Event code 299 (BTN_BASE6)
Event code 300 (?)
Event code 301 (?)
Event code 302 (?)
Event code 303 (BTN_DEAD)
Event code 304 (BTN_SOUTH)
Event code 305 (BTN_EAST)
Event code 306 (BTN_C)
Event code 307 (BTN_NORTH)
Event code 308 (BTN_WEST)
Event code 309 (BTN_Z)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
Event code 314 (BTN_SELECT)
Event code 315 (BTN_START)
Event code 316 (BTN_MODE)
Event code 317 (BTN_THUMBL)
Event code 318 (BTN_THUMBR)
Event code 319 (?)
Event code 320 (BTN_TOOL_PEN)
Event code 321 (BTN_TOOL_RUBBER)
Event code 322 (BTN_TOOL_BRUSH)
Event code 323 (BTN_TOOL_PENCIL)
Event code 324 (BTN_TOOL_AIRBRUSH)
Event code 325 (BTN_TOOL_FINGER)
Event code 326 (BTN_TOOL_MOUSE)
Event code 327 (BTN_TOOL_LENS)
Event code 328 (BTN_TOOL_QUINTTAP)
Event code 329 (?)
Event code 330 (BTN_TOUCH)
Event code 331 (BTN_STYLUS)
Event code 332 (BTN_STYLUS2)
Event code 333 (BTN_TOOL_DOUBLETAP)
Event code 334 (BTN_TOOL_TRIPLETAP)
Event code 335 (BTN_TOOL_QUADTAP)
Event code 336 (BTN_GEAR_DOWN)
Event code 337 (BTN_GEAR_UP)
Event code 338 (?)
Event code 339 (?)
Event code 340 (?)
Event code 341 (?)
Event code 342 (?)
Event code 343 (?)
Event code 344 (?)
Event code 345 (?)
Event code 346 (?)
Event code 347 (?)
Event code 348 (?)
Event code 349 (?)
Event code 350 (?)
Event code 351 (?)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 131
Min 0
Max 255
Flat 15
Event code 1 (ABS_Y)
Value 124
Min 0
Max 255
Flat 15
Event code 2 (ABS_Z)
Value 129
Min 0
Max 255
Flat 15
Event code 3 (ABS_RX)
Value 32
Min 0
Max 255
Flat 15
Resolution 46
Event code 4 (ABS_RY)
Value 33
Min 0
Max 255
Flat 15
Resolution 46
Event code 5 (ABS_RZ)
Value 132
Min 0
Max 255
Flat 15
Resolution 46
Event code 16 (ABS_HAT0X)
Value 0
Min -1
Max 1
Event code 17 (ABS_HAT0Y)
Value 0
Min -1
Max 1
Event code 18 (ABS_HAT1X)
Value 0
Min -1
Max 1
Event code 19 (ABS_HAT1Y)
Value 0
Min -1
Max 1
Event code 20 (ABS_HAT2X)
Value 0
Min -1
Max 1
Event code 21 (ABS_HAT2Y)
Value 0
Min -1
Max 1
Event code 22 (ABS_HAT3X)
Value 0
Min -1
Max 1
Event code 23 (ABS_HAT3Y)
Value 0
Min -1
Max 1
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1592736137.754436, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1592736137.754436, type 1 (EV_KEY), code 337 (BTN_GEAR_UP), value 1
Event: time 1592736137.754436, -------------- SYN_REPORT ------------
Event: time 1592736137.834549, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1592736137.834549, type 1 (EV_KEY), code 337 (BTN_GEAR_UP), value 0
Event: time 1592736137.834549, -------------- SYN_REPORT ------------
Event: time 1592736139.499562, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1592736139.499562, type 1 (EV_KEY), code 343 (?), value 1
正如您在最后看到的(我把它剪掉了,但由于我尝试了许多按钮,所以它更长),每个按钮和摇杆动作都成功检测到,尽管我无法确切地理解所有动作的含义。在我看来,许多动作都被计算机误解了。最让我困扰的可能是sudo udevadm info
on event26 的输出,它显示:
P: /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:0079:1846.000F/input/input37/event26
N: input/event26
S: input/by-id/usb-Nintendo_GameCube_Controller_Adapter_GH-GC-001_T10B-event-mouse
S: input/by-path/pci-0000:00:14.0-usb-0:3:1.0-event-mouse
E: DEVLINKS=/dev/input/by-id/usb-Nintendo_GameCube_Controller_Adapter_GH-GC-001_T10B-event-mouse /dev/input/by-path/pci-0000:00:14.0-usb-0:3:1.0-event-mouse
E: DEVNAME=/dev/input/event26
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:0079:1846.000F/input/input37/event26
E: ID_BUS=usb
E: ID_INPUT=1
E: ID_INPUT_TABLET=1
E: ID_MODEL=GameCube_Controller_Adapter
E: ID_MODEL_ENC=GameCube\x20Controller\x20Adapter
E: ID_MODEL_ID=1846
E: ID_PATH=pci-0000:00:14.0-usb-0:3:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_0
E: ID_REVISION=0100
E: ID_SERIAL=Nintendo_GameCube_Controller_Adapter_GH-GC-001_T10B
E: ID_SERIAL_SHORT=GH-GC-001_T10B
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Nintendo
E: ID_VENDOR_ENC=Nintendo
E: ID_VENDOR_ID=0079
E: LIBINPUT_DEVICE_GROUP=3/79/1846:usb-0000:00:14.0-3
E: MAJOR=13
E: MINOR=90
E: SUBSYSTEM=input
E: USEC_INITIALIZED=3899554972
整个“事件鼠标”的事情听起来就像计算机认为控制器是一个鼠标(尽管没有操纵杆可以充当鼠标)。
除了 uvtest 之外,控制器对任何应用程序都没有任何影响。我在 /dev/input 中没有 jsX,只有 event[0-26]、mice、mouse[0-4] ;我不知道这是否正常。
所以我请求你的帮助;感觉我们很接近了,但我真的不太了解 USB 设备和设备识别,所以我有点迷茫。
非常感谢您宝贵的帮助!
编辑。操纵杆包已安装;sudo jstest /dev/input/event26
返回以下内容:
Driver version is 0.8.0.
jstest is not fully compatible with your kernel. Unable to retrieve button map!
Joystick (Unknown) has 2 axes and 2 buttons.
Testing ... (interrupt to exit)
jstest: error reading: Invalid argument
尽管我不确定它是否相关。
此外,从几个线程和我在计算机中找到的 Steam 规则文件中获得灵感,我在 /lib/udev/rules.d 中创建了一条规则,并将其放入名为 89-gccontroller.rules 的文件中:
SUBSYSTEM=="usb", ENV{ID_CLASS}="joystick", ATTRS{idVendor}=="0079", ATTRS{idProduct}="1846", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1", TAG+= "uaccess", ENV{ID_INPUT_MOUSE}=""
显然无济于事。