---
name: "hidquirk"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/hidquirk"
---

# hidquirk(4)

HID quirks module

## NAME

**hidquirk** – HID quirks module

## SYNOPSIS

To compile this module into the kernel, place the following line in your kernel configuration file:

**device hid**

Alternatively, to load the module at boot time, place the following line in [loader.conf(5)](/loader.conf/5.md):

```
hidquirk_load="YES"
```

## DESCRIPTION

The **hidquirk** module provides support for adding quirks for HID devices

- HQ\_HID\_IGNORE

  device should be ignored by hid class

- HQ\_KBD\_BOOTPROTO

  device should set the boot protocol

- HQ\_MS\_BOOTPROTO

  device should set the boot protocol

- HQ\_MS\_BAD\_CLASS

  doesn't identify properly

- HQ\_MS\_LEADING\_BYTE

  mouse sends an unknown leading byte

- HQ\_MS\_REVZ

  mouse has Z-axis reversed

- HQ\_MS\_VENDOR\_BTN

  mouse has buttons in vendor usage page

- HQ\_SPUR\_BUT\_UP

  spurious mouse button up events

- HQ\_MT\_TIMESTAMP

  Multitouch device exports HW timestamps 0x1b5a01

See */sys/dev/hid/hidquirk.h* for the complete list of supported quirks.

## LOADER TUNABLE

The following tunable can be set at the [loader(8)](/loader/8.md) prompt before booting the kernel, or stored in [loader.conf(5)](/loader.conf/5.md).

- *hw.hid.quirk.%d*

  The value is a string whose format is:

  ```
  "BusId VendorId ProductId LowRevision HighRevision HQ_QUIRK,..."
  ```

  Installs the quirks **HQ\_QUIRK,...** for all HID devices matching **BusId** and **VendorId** and **ProductId** which have a hardware revision between and including **LowRevision** and **HighRevision**.

  **BusId**, **VendorId**, **ProductId**, **LowRevision** and **HighRevision** are all 16 bits numbers which can be decimal or hexadecimal based.

  A maximum of 100 variables **hw.hid.quirk.0,** **.1,** **...,** **.99** can be defined.

  If a matching entry is found in the kernel's internal quirks table, it is replaced by the new definition.

  Else a new entry is created given that the quirk table is not full.

  The kernel iterates over the **hw.hid.quirk.N** variables starting at **N** **=** **0** and stops at **N** **=** **99** or the first non-existing one.

## EXAMPLES

To install a quirk at boot time, place one or several lines like the following in [loader.conf(5)](/loader.conf/5.md):

```
hw.hid.quirk.0="0x18 0x6cb 0x1941 0 0xffff HQ_MT_TIMESTAMP"
```

## HISTORY

The **hidquirk** module appeared in FreeBSD 13.0.

## AUTHORS

The **hidquirk** driver was written by Hans Petter Selasky ⟨*hselasky@FreeBSD.org*⟩ for [usb(4)](/usb/4.md) subsystem and adopted to hid(4) by Vladimir Kondratyev ⟨*wulf@FreeBSD.org*⟩. This manual page is based on [usb\_quirk(4)](/usb_quirk/4.md) manual page written by Nick Hibma ⟨*n\_hibma@FreeBSD.org*⟩.
