Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
/**
|
|
|
|
|
@page device-quirks Device quirks
|
|
|
|
|
|
|
|
|
|
libinput requires extra information from devices that is not always readily
|
|
|
|
|
available. For example, some touchpads are known to have jumping cursors
|
|
|
|
|
under specific conditions. libinput ships a set of files containting the
|
|
|
|
|
so-called model quirks to provide that information. Model quirks are usually
|
|
|
|
|
installed under `/usr/share/libinput/<filename>.quirks` and are standard
|
|
|
|
|
`.ini` files. A file may contain multiple section headers (`[some
|
|
|
|
|
identifier]`) followed by one or more `MatchFoo=Bar` directives, followed by
|
|
|
|
|
at least one of `ModelFoo=1` or `AttrFoo=bar` directive. See the
|
2018-07-13 12:57:02 +10:00
|
|
|
`quirks/README.md` file in the libinput source repository for more details on
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
their contents.
|
|
|
|
|
|
|
|
|
|
@note Model quirks are internal API and may change at any time. No
|
|
|
|
|
backwards-compatibility is guaranteed.
|
|
|
|
|
|
|
|
|
|
For example, a quirks file may have this content to label all keyboards on
|
|
|
|
|
the serial bus (PS/2) as internal keyboards:
|
|
|
|
|
|
|
|
|
|
@verbatim
|
|
|
|
|
[Serial Keyboards]
|
|
|
|
|
MatchUdevType=keyboard
|
|
|
|
|
MatchBus=serial
|
|
|
|
|
AttrKeyboardIntegration=internal
|
|
|
|
|
@endverbatim
|
|
|
|
|
|
|
|
|
|
The model quirks are part of the source distribution and should never be
|
|
|
|
|
modified locally. Updates to libinput may overwrite modifications or even
|
|
|
|
|
stop parsing any property. For temporary local workarounds, see @ref
|
|
|
|
|
device-quirks-local.
|
|
|
|
|
|
|
|
|
|
Device quirks are parsed on libinput initialization. A parsing error in the
|
|
|
|
|
device quirks disables **all** device quirks and may negatively impact
|
|
|
|
|
device behavior on the host. If the quirks cannot be loaded, an error
|
|
|
|
|
message is posted to the log and users should use the information in @ref
|
|
|
|
|
device-quirks-debugging to verify their quirks files.
|
|
|
|
|
|
|
|
|
|
@section device-quirks-local Installing temporary local device quirks
|
|
|
|
|
|
|
|
|
|
The model quirks are part of the source distribution and should never be
|
|
|
|
|
modified. For temporary local workarounds, libinput reads the
|
|
|
|
|
`/etc/libinput/local-overrides.quirks` file. Users may add a sections to
|
|
|
|
|
this file to add a device quirk for a local device but beware that **any
|
|
|
|
|
modification must be upstreamed** or it may cease to work at any time.
|
|
|
|
|
|
|
|
|
|
@note Model quirks are internal API and may change at any time. No
|
|
|
|
|
backwards-compatibility is guaranteed. Local overrides should only be used
|
|
|
|
|
until the distribution updates the libinput packages.
|
|
|
|
|
|
|
|
|
|
The `local-overrides.quirks` file usually needs to be created by the user.
|
|
|
|
|
Once the required section has been added, use the information from section
|
|
|
|
|
@ref device-quirks-debugging to validate and test the quirks.
|
|
|
|
|
|
|
|
|
|
@section device-quirks-debugging Debugging device quirks
|
|
|
|
|
|
2018-06-26 13:15:13 +10:00
|
|
|
libinput provides the `libinput quirks` tool to debug the quirks database.
|
|
|
|
|
This tool takes an action as first argument, the most common invocation is
|
|
|
|
|
`libinput quirks list` to list model quirks that apply to one or more local
|
|
|
|
|
devices.
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
|
|
|
|
|
@verbatim
|
2018-06-26 13:15:13 +10:00
|
|
|
$ libinput quirks list /dev/input/event19
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
Device has no quirks defined
|
2018-06-26 13:15:13 +10:00
|
|
|
$ libinput quirks list /dev/input/event0
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
AttrLidSwitchReliability
|
|
|
|
|
@endverbatim
|
|
|
|
|
|
2018-06-26 13:15:13 +10:00
|
|
|
When called with the `--verbose` argument, `libinput quirks list` prints
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
information about all files and its attempts to match the device:
|
|
|
|
|
|
|
|
|
|
@verbatim
|
2018-06-26 13:15:13 +10:00
|
|
|
$ libinput quirks list --verbose /dev/input/event0
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
quirks debug: /usr/share/share/libinput is data root
|
|
|
|
|
quirks debug: /usr/share/share/libinput/10-generic-keyboard.quirks
|
|
|
|
|
quirks debug: /usr/share/share/libinput/10-generic-lid.quirks
|
|
|
|
|
[...]
|
|
|
|
|
quirks debug: /usr/share/etc/libinput/local-overrides.quirks
|
|
|
|
|
quirks debug: /dev/input/event0: fetching quirks
|
|
|
|
|
quirks debug: [Serial Keyboards] (10-generic-keyboard.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Lid Switch Ct9] (10-generic-lid.quirks) matches for MatchName
|
|
|
|
|
quirks debug: [Lid Switch Ct10] (10-generic-lid.quirks) matches for MatchName
|
|
|
|
|
quirks debug: [Lid Switch Ct10] (10-generic-lid.quirks) matches for MatchDMIModalias
|
|
|
|
|
quirks debug: [Lid Switch Ct10] (10-generic-lid.quirks) is full match
|
|
|
|
|
quirks debug: property added: AttrLidSwitchReliability from [Lid Switch Ct10] (10-generic-lid.quirks)
|
|
|
|
|
quirks debug: [Aiptek No Tilt Tablet] (30-vendor-aiptek.quirks) wants MatchBus but we don't have that
|
|
|
|
|
[...]
|
|
|
|
|
quirks debug: [HUION PenTablet] (30-vendor-huion.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Logitech Marble Mouse Trackball] (30-vendor-logitech.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Logitech K400] (30-vendor-logitech.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Logitech K400r] (30-vendor-logitech.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Logitech K830] (30-vendor-logitech.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Logitech K400Plus] (30-vendor-logitech.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Logitech Wireless Touchpad] (30-vendor-logitech.quirks) wants MatchBus but we don't have that
|
|
|
|
|
quirks debug: [Microsoft Surface 3 Lid Switch] (30-vendor-microsoft.quirks) matches for MatchName
|
|
|
|
|
[...]
|
|
|
|
|
AttrLidSwitchReliability
|
|
|
|
|
@endverbatim
|
|
|
|
|
|
|
|
|
|
Note that this is an example only, the output may change over time. The tool
|
|
|
|
|
uses the same parser as libinput and any parsing errors will show up in the
|
|
|
|
|
output.
|
|
|
|
|
|
|
|
|
|
*/
|