libinput/quirks/50-system-apple.quirks

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

157 lines
3.6 KiB
Text
Raw Permalink Normal View History

# Do not edit this file, it will be overwritten on update
[Apple Touchpads USB]
MatchVendor=0x05AC
MatchBus=usb
MatchUdevType=touchpad
ModelAppleTouchpad=1
AttrSizeHint=104x75
AttrTouchSizeRange=150:130
AttrPalmSizeThreshold=1600
[Apple Touchpads Bluetooth]
MatchVendor=0x05AC
MatchBus=bluetooth
MatchUdevType=touchpad
ModelAppleTouchpad=1
AttrTouchSizeRange=150:130
[Apple Touchpads Bluetooth (new vendor ID)]
MatchVendor=0x004C
MatchBus=bluetooth
MatchUdevType=touchpad
ModelAppleTouchpad=1
AttrTouchSizeRange=150:130
[Apple Internal Keyboard]
MatchName=*Apple Inc. Apple Internal Keyboard*
AttrKeyboardIntegration=internal
[Apple Internal Keyboard (SPI)]
MatchUdevType=keyboard
MatchBus=spi
MatchVendor=0x05AC
AttrKeyboardIntegration=internal
# The Apple MagicMouse has a touchpad built-in but the kernel still
# emulates a full 2/3 button mouse for us. Ignore anything from the
# ABS interface
[Apple MagicMouse]
MatchUdevType=mouse
MatchBus=bluetooth
MatchVendor=0x05AC
MatchProduct=0x030D
quirks: allow overriding of AttrEventCode and AttrInputProp This switches the quirk from AttrEventCodeEnable/Disable to just AttrEventCode with a +/- prefix for each entry. This switches the quirk from AttrInputPropEnable/Disable to just AttrInputProp with a +/- prefix for each entry. Previously, both event codes and input props would only apply the last-matching section entry for a device. Furthermore, an earlier Disable entry would take precedence over a later Enable entry. For example, a set of sections with these lines *should* enable left, right and middle: [first] AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;BTN_MIDDLE [second] AttrEventCodeDisable=BTN_RIGHT [third] AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT; Alas: the first line was effectively ignored (quirks only returned the last-matching one, i.e. the one from "third"). And due to implementation details in evdev.c, the Disable attribute was processed after Enable, i.e. the device was enabled for left + right and then disabled for right. As a result, the device only had BTN_LEFT enabled. Fix this by changing the attribute to carry both enable/disable information and merging the commands together. Internally, all quirks matching a device are simply ref'd into an array in the struct quirks. The applied value is simply the last entry in the array corresponding to our quirk. For AttrEventCode and AttrInputProp instead do this: - switch them to a tuple with the code as first entry and a boolean enable/disable as second entry - if the struct quirk already has an entry for either, append the more recent one to the existing entry (instead of creating a new entry in the array). This way we have all entries that match and in-order of precedence - i.e. we can process them left-to-right to end up with the right state. Fixes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/821 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-15 13:53:43 +10:00
AttrEventCode=-EV_ABS
# The External Apple "Magic" trackpads, both the 1st and 2nd generations, have
# pretty good built-in spurious touch filtering in the device firmware. Using
# low enough values such as 20:10 effectively disables libinput's filtering.
[Apple Magic Trackpad v1 (2010, clickpad)]
MatchUdevType=touchpad
MatchBus=bluetooth
MatchVendor=0x05AC
MatchProduct=0x030E
AttrSizeHint=130x110
AttrTouchSizeRange=20:10
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=700
# 2nd generation trackpad can be connected over Bluetooth as well as USB.
[Apple Magic Trackpad v2 (2015)]
MatchVendor=0x05AC
MatchProduct=0x0265
AttrSizeHint=162x115
AttrTouchSizeRange=20:10
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=800
AttrPalmPressureThreshold=190
[Apple Magic Trackpad v2 (new vendor ID)]
MatchVendor=0x004C
MatchProduct=0x0265
AttrSizeHint=162x115
AttrTouchSizeRange=20:10
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=800
AttrPalmPressureThreshold=190
[Apple Magic Trackpad v2 Bluetooth (2024)]
MatchVendor=0x004C
MatchProduct=0x0324
AttrSizeHint=162x115
AttrTouchSizeRange=20:10
AttrPressureRange=3:0
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=700
[Apple Magic Trackpad v2 USB-C (2024)]
MatchBus=usb
MatchVendor=0x05AC
MatchProduct=0x0324
AttrTouchSizeRange=20:10
AttrPressureRange=3:0
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=700
[Apple Touchpad OneButton]
MatchUdevType=touchpad
MatchBus=usb
MatchVendor=0x05AC
MatchProduct=0x021A
ModelAppleTouchpadOneButton=1
[Apple Touchpad OneButton A1181]
MatchUdevType=touchpad
MatchBus=usb
MatchVendor=0x05AC
MatchProduct=0x022A
ModelAppleTouchpadOneButton=1
[Apple Touchpad MacbookPro5,5]
MatchUdevType=touchpad
MatchBus=usb
MatchVendor=0x05AC
MatchProduct=0x0237
AttrPalmSizeThreshold=1000
[Apple Laptop Touchpad (MacBookPro11,2 among others)]
MatchUdevType=touchpad
MatchBus=usb
MatchVendor=0x05AC
MatchProduct=0x0262
AttrPalmSizeThreshold=1600
[Apple Laptop Touchpad (SPI)]
MatchUdevType=touchpad
MatchBus=spi
MatchVendor=0x05AC
ModelAppleTouchpad=1
AttrSizeHint=104x75
AttrTouchSizeRange=150:130
AttrPalmSizeThreshold=1600
[Apple Laptop Touchpad (MTP)]
MatchUdevType=touchpad
MatchName=Apple*MTP*
MatchVendor=0x05AC
ModelAppleTouchpad=1
AttrSizeHint=104x75
AttrTouchSizeRange=150:130
AttrPalmSizeThreshold=1600
[Apple Laptop Keyboard (MTP)]
MatchUdevType=keyboard
MatchName=Apple*MTP*
MatchVendor=0x05AC
AttrKeyboardIntegration=internal
# The Linux applespi driver currently uses the Synaptics vendor for some reason
[Apple Laptop Touchpad (SPI) applespi driver]
MatchUdevType=touchpad
MatchBus=spi
MatchVendor=0x06CB
ModelAppleTouchpad=1
AttrSizeHint=104x75
AttrTouchSizeRange=150:130
AttrPalmSizeThreshold=1600