11

This is the adapter which I am trying to get working: Amazon - Mayflash Wii U Pro Controller usb adapter This adapter has two modes, an xbox input mode and a generic hid mode. The xbox mode works fine on Ubuntu but it only supports one controller. In generic controller mode 4 controllers are supported. I'm having difficulty using it on Ubuntu in this mode because it is moving the mouse around and games don't recognize that a controller is plugged in.

First I would like it to stop moving my mouse around. I'm hoping that fixing this problem will help me fix the second one. Here is some information to get started.

xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ HJZ Mayflash WiiU Pro Game Controller Adapter     id=8    [slave  pointer  (2)]
⎜   ↳ Logitech M310                             id=9    [slave  pointer  (2)]
⎜   ↳ Logitech K520                             id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Eee PC WMI hotkeys                        id=11   [slave  keyboard (3)]

xinput list-props 8
Device 'HJZ Mayflash WiiU Pro Game Controller Adapter':
        Device Enabled (143):   1
        Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (276):     0
        Device Accel Constant Deceleration (277):       1.000000
        Device Accel Adaptive Deceleration (278):       1.000000
        Device Accel Velocity Scaling (279):    10.000000
        Device Product ID (260):        121, 6144
        Device Node (261):      "/dev/input/event2"
        Evdev Axis Inversion (280):     0, 0
        Evdev Axis Calibration (281):   <no items>
        Evdev Axes Swap (282):  0
        Axis Labels (283):      "Abs X" (264), "Abs Y" (265), "Abs Z" (266), "Abs Rotary Z" (267), "Abs Hat 0 X" (268), "Abs Hat 0 Y" (269), "Abs Hat 1 X" (270), "Abs Hat 1 Y" (271), "Abs Hat 2 X" (272), "Abs Hat 2 Y" (273), "Abs Hat 3 X" (274), "Abs Hat 3 Y" (275)
        Button Labels (284):    "Button Unknown" (263), "Button Unknown" (263), "Button Unknown" (263), "Button Wheel Up" (149), "Button Wheel Down" (150), "Button Horiz Wheel Left" (151), "Button Horiz Wheel Right" (152)
        Evdev Scrolling Distance (285): 0, 0, 0
        Evdev Middle Button Emulation (286):    0
        Evdev Middle Button Timeout (287):      50
        Evdev Third Button Emulation (288):     0
        Evdev Third Button Emulation Timeout (289):     1000
        Evdev Third Button Emulation Button (290):      3
        Evdev Third Button Emulation Threshold (291):   20
        Evdev Wheel Emulation (292):    0
        Evdev Wheel Emulation Axes (293):       0, 0, 4, 5
        Evdev Wheel Emulation Inertia (294):    10
        Evdev Wheel Emulation Timeout (295):    200
        Evdev Wheel Emulation Button (296):     4
        Evdev Drag Lock Buttons (297):  0

I can't disable mouse events prop because it isn't listed.

I have tried removing xserver-xorg-input-joystick and I have tried installing it and adding the custom joystick config as /usr/share/X11/xorg.conf.d/50-joystick.conf

Section "InputClass"
        Identifier "joystick catchall"
        MatchIsJoystick "on"
        MatchDevicePath "/dev/input/event*"
        Driver "joystick"
        Option "StartKeysEnabled" "False"       #Disable mouse
        Option "StartMouseEnabled" "False"      #support
EndSection

I believe these are the relevant lines in dmesg:

[    1.259673] usb 1-4.2: new full-speed USB device number 4 using xhci_hcd
[    1.352076] usb 1-4.2: New USB device found, idVendor=0079, idProduct=1800
[    1.352078] usb 1-4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.352080] usb 1-4.2: Product: Mayflash WiiU Pro Game Controller Adapter
[    1.352081] usb 1-4.2: Manufacturer: HJZ
[    1.361980] input: HJZ Mayflash WiiU Pro Game Controller Adapter as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.2/1-4.2:1.0/0003:0079:1800.0006/input/input5
[    1.362154] hid-generic 0003:0079:1800.0006: input,hidraw1: USB HID v1.11 Joystick [HJZ Mayflash WiiU Pro Game Controller Adapter] on usb-0000:00:14.0-4.2/input0

Why is that hidraw1?

What else can I try?

DavidW
  • 310

3 Answers3

9

To stop the joystick from controlling the mouse is actually really easy, after much searching finally stumbled across it, in the current versions of ubuntu xorg.conf isn't used, instead you have files in. /usr/share/X11/xorg.conf.d/ You have to go to this folder as root and edit '50-joystick.conf' so:

sudo su
cd /usr/share/X11/xorg.conf.d/
nano 50-joystick.conf

The file should look like this:

Section "InputClass"
  Identifier "joystick catchall"
  MatchIsJoystick "on"
  MatchDevicePath "/dev/input/event*"
  Driver "joystick"

Add these two lines to disable mouse emulation:

Option "StartKeysEnabled" "False" Option "StartMouseEnabled" "False" EndSection

Once you added the two 'Option' lines save the file (Ctrl+O) and exit (Ctrl+X). Now restart linux, the joystick works in games but no longer runs the mouse around the screen or traps him in the top left corner.

Erin
  • 91
6

Something along the lines of:

xinput set-prop 'HJZ Mayflash WiiU Pro Game Controller Adapter' "Device Enabled" 0

should make it stop acting as mouse. You might also want to run

sudo evtest /dev/input/event2 (or wherever your controller is)

to get an idea of why this is happening in the first place.

Grumbel
  • 4,879
1

If you're still having this issue, I figured out a solution. This was done on a Raspberry Pi, but it should work on Ubuntu as well (I don't know how to edit the command line on Ubuntu but I'm sure there's a way to do it easily).

Copied from my post on reddit: https://www.reddit.com/r/RetroPie/comments/3drzqt/anyone_using_a_wii_u_pro_controller_adapter_with/

Run lsusb -v and look for the idVendor and idProduct of your Mayflash adapter (they were 0x0079 and 0x1800, respectively, for me).

Add the following string to the end of your /boot/cmdline.txt file:

usbhid.quirks=idVendor:idProduct:0x40

Replace idVendor and idProduct with the values you found earlier. Make sure you include the "0x" prefixes.

Reboot your pi:

sudo reboot

You should now see js0, js1, js2, and js3 in /dev/input.