# USB laser mouse only works if an older mouse is also connected



## ajohnl (Apr 10, 2016)

So I have a gaming mouse that won't work, however the side buttons (assigned to 1, 2 and 3, for gaming) work as they are set in the mouse's settings and don't depend on software.

The mouse is a Keep Out X6 gaming mouse, `usbconfig -d ugen4.4 dump_device_desc` gets me:


```
<USB Gaming Mouse Holtek> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x04d9
  idProduct = 0xa067
  bcdDevice = 0x0116
  iManufacturer = 0x0001  <Holtek>
  iProduct = 0x0002  <USB Gaming Mouse>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001
```

The interesting part is that it works when I boot while having a different mouse connected:

```
<USB Mouse vendor 0x1267> at usbus4, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (48mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x1267
  idProduct = 0x0201
  bcdDevice = 0x0230
  iManufacturer = 0x0000  <no string>
  iProduct = 0x0001  <USB Mouse>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001
```

The second mouse is an old Hama AM-2000 optical mouse that I tested as a replacement before I found out it made my main mouse work. Anyways, I suspect that the gaming mouse's additional buttons make it get detected as a keyboard, stopping moused from loading. Is there a way to force the loading of mouse drivers? Or perhaps a quirk to keep my mouse from getting detected as a keyboard?

/etc/rc.conf:

```
keymap="spanish.iso.kbd"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
```


----------



## SirDice (Apr 11, 2016)

There's no need for moused_enable in rc.conf for USB mice. It's only needed for PS/2 mice. USB mice load it automatically through devd(8).


----------



## ajohnl (Apr 11, 2016)

SirDice said:


> There's no need for moused_enable in rc.conf for USB mice. It's only needed for PS/2 mice. USB mice load it automatically through devd(8).




I'll try disabling it, but is there a similar setting to make sure usb mouse drivers are loaded even if there's no mouse attached?


----------



## SirDice (Apr 11, 2016)

The mouse "driver" (ums(4)) is part of the GENERIC kernel and is already loaded. moused(8) is loaded whenever a USB mouse is detected:

/etc/devd.conf:

```
notify 100 {
        match "system" "DEVFS";
        match "subsystem" "CDEV";
        match "type" "CREATE";
        match "cdev" "ums[0-9]+";

        action "/etc/rc.d/moused quietstart $cdev";
};
```


----------



## ajohnl (Apr 11, 2016)

SirDice said:


> The mouse "driver" (ums(4)) is part of the GENERIC kernel and is already loaded. moused(8) is loaded whenever a USB mouse is detected:
> 
> /etc/devd.conf:
> 
> ...



Any known quirk that keeps the mouse from being detected as a keyboard on boot?


----------



## SirDice (Apr 11, 2016)

Not from me, I never had to deal with mice like that.


----------



## protocelt (Apr 11, 2016)

A quick Google search shows the mouse not working under Linux correctly as well. The posts I skimmed were a few years old so not sure if that is still the case. As an alternative, you could try setting up the sysutils/uhidd port to work with it. You might have better results.


----------



## ajohnl (Apr 11, 2016)

protocelt said:


> A quick Google search shows the mouse not working under Linux correctly as well. The posts I skimmed were a few years old so not sure if that is still the case. As an alternative, you could try setting up the sysutils/uhidd port to work with it. You might have better results.



I've been using the same mouse since I built my computer on Linux, and I'm currently using it with Funtoo (Gentoo with tweaks) and it works perfectly (although configuration must be done with a windows VM), any errors related to it are probably due to BIOS settings.


----------



## ajohnl (Apr 17, 2016)

Is there a way to set up a virtual mouse that will trigger mouse drivers to load at boot?


----------



## SirDice (Apr 20, 2016)

The only mouse drivers are ums(4) and psm(4), both are loaded by default in the GENERIC kernel.


----------



## ajohnl (Apr 22, 2016)

SirDice said:


> The only mouse drivers are ums(4) and psm(4), both are loaded by default in the GENERIC kernel.


I understand that they are loaded at boot, but they don't seem to activate unless they actually detect a mouse. For example, the mouse in terminal won't appear if there's no mouse. Is there a way to make a virtual mouse to make the drivers think there's a mouse connected? In GNU/Linux one can make fake displays for example. Another option is a quirk to make the mouse appear as a mouse and not a keyboard, I've tried 
UQ_KBD_IGNORE with no success but maybe there are any other quirks to try?


----------



## SirDice (Apr 22, 2016)

Ah, right. Now I understand what you meant. I'm not aware of anything like that (but that doesn't mean it's not there, I just don't know it).


----------

