You are not logged in.

#1 2023-11-25 17:33:08

theramatrix
Member
Registered: 2023-11-25
Posts: 22

How can I configure a USB device to register properly as a mouse?

Running Arch Linux with KDE and Wayland server.

I have a Monoprice Displayport KVM switch, which has two dedicated ports for a mouse and keyboard. Functions with no issue on the desktop, but in gaming mouselook doesn't work (though mouse buttons do).

Typing in

lsusb -v

gets me this:

Bus 001 Device 007: ID 0b95:6804 ASIX Electronics Corp. AX68004
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.01
  bDeviceClass            9 Hub
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0         8
  idVendor           0x0b95 ASIX Electronics Corp.
  idProduct          0x6804 AX68004
  bcdDevice            0.12
  iManufacturer           1  MTK Electronics
  iProduct                2 AX68004
  iSerial                 3 00000003
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 [unknown]
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval             255

Bus 001 Device 011: ID 0b95:6801 ASIX Electronics Corp. AX68004
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0b95 ASIX Electronics Corp.
  idProduct          0x6801 AX68004
  bcdDevice            0.02
  iManufacturer           1 ASIX Electronics
  iProduct                2 AX68004
  iSerial                 3 00000003
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0054
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      63
          Report Descriptors: 
            ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     110
          Report Descriptors: 
            ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0007  1x 7 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      93
          Report Descriptors: 
            ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0007  1x 7 bytes
        bInterval               1

Since the device allows switching input by moving the mouse to the edge of the screen, I'm guessing the KVM poses as a mouse, intercepts any real mice, reads the data it needs, then retransmits the input to the upstream device, but for some reason programs are able to register the mouse movement data.

How can I fix this?

Last edited by theramatrix (2023-11-25 17:53:13)

Offline

#2 2023-11-26 10:42:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,054

Re: How can I configure a USB device to register properly as a mouse?

in gaming mouselook doesn't work (though mouse buttons do) … the device allows switching input by moving the mouse to the edge of the screen

The game will have to grab the mouse (I suspect this is Xwayland?) to handle the motion what could be a problem w/ the switching-input magic.

Does it work on X11?
Does it work when you run the game in windowed mode?
What "game" is it actually? Does https://archlinux.org/packages/extra/x86_64/warsow/ work?

Offline

#3 2023-11-26 11:20:41

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: How can I configure a USB device to register properly as a mouse?

seth wrote:

Does it work on X11?

It does, but behavior is very erratic. The mouse sensitivity is unplayably high, and it seems to think I'm moving the mouse down so I'm constantly looking at the floor

seth wrote:

Does it work when you run the game in windowed mode?

No, sadly.

seth wrote:

What "game" is it actually?

Tried Counter Strike 2, Left 4 Dead 2, Hitman 3, and Unturned. All have the same issue, so it does not seem to be a bug in a specific engine or Proton.

It does not. In fact, it's worse, even the mouse clicks don't register in this game.

Offline

#4 2023-11-26 13:12:02

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,096

Re: How can I configure a USB device to register properly as a mouse?

https://www.monoprice.com/product?p_id=36652 shows 4 input ports :

1 labeled mouse
1 labeled keyboard
2 generic usb ports

Which of those ports is the mouse connected to ?
Have you tried changing the port ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2023-11-26 16:17:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,054

Re: How can I configure a USB device to register properly as a mouse?

Another thing, what kind of mouse is it?
Many of the more fancy gaming mice will show up as mouse and keyboard and also the kvm will prevent the libinput quirks from applying.
If it's such model, try susbstituting it w/ a $5 3-button office-mouse.

Offline

#6 2023-12-01 18:17:14

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: How can I configure a USB device to register properly as a mouse?

Sorry for the late reply, my weekdays are quite busy.

Lone_Wolf wrote:

https://www.monoprice.com/product?p_id=36652 shows 4 input ports :

1 labeled mouse
1 labeled keyboard
2 generic usb ports

Which of those ports is the mouse connected to ?
Have you tried changing the port ?

The one I have is actually this one https://www.monoprice.com/product?p_id=42646. I did try all four ports and the unmarked "normal" ones don't have the mouselook issue, but gone with it is the lose the ability to switch PCs as well as convenient front-facing USB ports, so I'm hoping for a better solution...

seth wrote:

Another thing, what kind of mouse is it?
Many of the more fancy gaming mice will show up as mouse and keyboard and also the kvm will prevent the libinput quirks from applying.
If it's such model, try susbstituting it w/ a $5 3-button office-mouse.

It's a Logitech G402 but it doesn't seem to be relevant - I grabbed an old Compaq mouse and mouselook doesn't work either.

Offline

#7 2023-12-02 08:31:23

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,054

Re: How can I configure a USB device to register properly as a mouse?

Does the device behave weird™ in "sudo libinput debug-events" w/ weird being anything like
- spurious input is generated (incl. spurious keyboard events)
- the pointer motion has implausible distances
  * huge values for timid physical movements
  * axis reversed (+/- seems wrong)

Offline

#8 2023-12-03 15:57:09

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: How can I configure a USB device to register properly as a mouse?

seth wrote:

Does the device behave weird™ in "sudo libinput debug-events" w/ weird being anything like
- spurious input is generated (incl. spurious keyboard events)
- the pointer motion has implausible distances
  * huge values for timid physical movements
  * axis reversed (+/- seems wrong)

Revelations! My guess that the KVM interprets mouse movement data is correct, but more importantly, the fake mouse from the KVM is in absolute coordinates. So apparently the issue is that games can only understand relative mouse movement.

I don't think this can be changed on the KVM itself, so would there be a software solution for this?

Offline

#9 2023-12-03 22:10:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,054

Re: How can I configure a USB device to register properly as a mouse?

Does the device show up as touchpad or as mouse?

udevadm info --path=/sys/class/input/<device_directory>

Offline

#10 2023-12-04 18:17:42

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: How can I configure a USB device to register properly as a mouse?

seth wrote:

Does the device show up as touchpad or as mouse?

udevadm info --path=/sys/class/input/<device_directory>

This is the output I get:

P: /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.4/1-3.4.6/1-3.4.6:1.2/0003:0B95:6801.000B/input/input38/event9
M: event9
R: 9
U: input
D: c 13:73
N: input/event9
L: 0
S: input/by-id/usb-ASIX_Electronics_AX68004_00000003-if02-event-mouse
S: input/by-path/pci-0000:00:14.0-usb-0:3.4.6:1.2-event-mouse
S: input/by-path/pci-0000:00:14.0-usbv2-0:3.4.6:1.2-event-mouse
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.4/1-3.4.6/1-3.4.6:1.2/0003:0B95:6801.000B/input/input38/event9
E: SUBSYSTEM=input
E: DEVNAME=/dev/input/event9
E: MAJOR=13
E: MINOR=73
E: USEC_INITIALIZED=1485178446
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_BUS=usb
E: ID_MODEL=AX68004
E: ID_MODEL_ENC=AX68004
E: ID_MODEL_ID=6801
E: ID_SERIAL=ASIX_Electronics_AX68004_00000003
E: ID_SERIAL_SHORT=00000003
E: ID_VENDOR=ASIX_Electronics
E: ID_VENDOR_ENC=ASIX\x20Electronics
E: ID_VENDOR_ID=0b95
E: ID_REVISION=0002
E: ID_TYPE=hid
E: ID_USB_MODEL=AX68004
E: ID_USB_MODEL_ENC=AX68004
E: ID_USB_MODEL_ID=6801
E: ID_USB_SERIAL=ASIX_Electronics_AX68004_00000003
E: ID_USB_SERIAL_SHORT=00000003
E: ID_USB_VENDOR=ASIX_Electronics
E: ID_USB_VENDOR_ENC=ASIX\x20Electronics
E: ID_USB_VENDOR_ID=0b95
E: ID_USB_REVISION=0002
E: ID_USB_TYPE=hid
E: ID_USB_INTERFACES=:030101:030102:
E: ID_USB_INTERFACE_NUM=02
E: ID_USB_DRIVER=usbhid
E: ID_PATH_WITH_USB_REVISION=pci-0000:00:14.0-usbv2-0:3.4.6:1.2
E: ID_PATH=pci-0000:00:14.0-usb-0:3.4.6:1.2
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_4_6_1_2
E: LIBINPUT_DEVICE_GROUP=3/b95/6801:usb-0000:00:14.0-3.4
E: DEVLINKS=/dev/input/by-id/usb-ASIX_Electronics_AX68004_00000003-if02-event-mouse /dev/input/by-path/pci-0000:00:14.0-usb-0:3.4.6:1.2-event-mouse /dev/input/by-path/pci-0000:00:14.0-usbv2-0:3.4.6:1.2-event-mouse

Offline

#11 2023-12-04 19:55:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,054

Re: How can I configure a USB device to register properly as a mouse?

"ID_INPUT_MOUSE=1"

You could add a udev rule that sets that to "0" and ID_INPUT_TOUCHPAD=1, but
1. no idea whether that helps your game at all
2. typically you'll need an EV_ABS setting for the global coordinate system as well

Did you ensure that the mouse produces relative coordinates when using one of the generic ports?

Offline

#12 2023-12-05 06:59:45

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: How can I configure a USB device to register properly as a mouse?

Ugh - I think this is going down the path of spending a dollar to save a dime. I think I'm just going to unplug and replug the mouse when I need to.

Thanks for the help, y'all.

Offline

Board footer

Powered by FluxBB