Configure touchpad

Configure touchpad settings by adding a matching rule to the hardware database and updating systemd-hwdb.

The touchpad that acts like a mouse

You attach a new laptop or connect an external trackpad. The pointer moves across the screen, but scrolling feels wrong. Tapping does nothing. The desktop environment treats it like a generic USB mouse. You open the settings panel and find no touchpad options. The hardware is perfectly fine. The kernel just misclassified it.

What the kernel actually sees

Linux uses the udev subsystem to assign properties to hardware the moment it appears on the system. The kernel driver reports raw capabilities to userspace. udev matches those capabilities against rules and databases. If the database lacks a matching entry, the device falls back to a generic input class. libinput then receives a mouse instead of a touchpad. You lose gestures, edge scrolling, and tap-to-click. The fix is not a desktop setting. The fix is telling the hardware database exactly what the device is.

The hardware database works like a lookup table. You provide a matching key on the left side and a property assignment on the right side. The key uses a simple pattern language. The property tells the input subsystem how to treat the device. Once you write the entry and rebuild the database, every future boot applies the classification automatically. The database does not run as a service. It is a static index that udev reads during device enumeration and hotplug events.

Write the rule before you reboot. A misclassified device will not fix itself on the next login.

Forcing recognition with the hardware database

Here is how to locate the device and force the correct classification.

First, find the event node that represents your touchpad. Run the listing command and look for the device name in the output.

ls -l /dev/input/by-path/
# Lists symlinks that map physical ports to event nodes
# Look for entries containing touchpad or trackpad
# Note the event number, for example event7

Once you have the event number, check the current properties to see what the kernel already knows.

udevadm info --query=all --name=/dev/input/event7
# Replaces event7 with your actual device node
# Shows every property udev has assigned so far
# Look for ID_INPUT_TOUCHPAD or ID_INPUT_MOUSE

If the output shows ID_INPUT_MOUSE=1 and nothing else, the device is missing its touchpad flag. Create a new hardware database file in the local configuration directory. Files in /etc/udev/hwdb.d/ override package defaults and survive system updates. Never edit files in /usr/lib/udev/hwdb.d/. Those ship with the udev package and get overwritten on the next dnf upgrade --refresh.

sudo nano /etc/udev/hwdb.d/50-touchpad.hwdb
# Opens the local hardware database override file
# The 50 prefix ensures it loads after base rules
# Use sudo because /etc/udev/ requires root permissions

Paste the matching rule and property assignment into the editor. The syntax requires a tab character between the key and the property. Indentation on the property line must also be a tab.

touchpad:*
# Matches any device with the touchpad prefix in its modalias
# The asterisk acts as a wildcard for the rest of the string
# Press Tab here, not spaces
    ID_INPUT_TOUCHPAD=1
# Forces the input subsystem to classify the device as a touchpad
# This overrides the default mouse fallback behavior
# Press Tab here as well

Save the file and exit. The database is not active yet. You must rebuild the binary index so udev can read it efficiently.

sudo systemd-hwdb update
# Compiles all text files in hwdb.d into a single binary database
# Runs instantly on modern systems
# Required after every hwdb file change

Trigger a re-read of the device properties without unplugging anything.

udevadm trigger --subsystem-match=input --action=change
# Forces udev to reapply all rules to matching devices
# Simulates a hotplug event for the input subsystem
# Takes effect immediately without a reboot

Run systemd-hwdb update before you test. The text file does nothing until the binary index is rebuilt.

Verify the device is classified correctly

Here is how to confirm the kernel now recognizes the device correctly.

Run the property query again and watch for the new flag.

udevadm info --query=all --name=/dev/input/event7 | grep ID_INPUT
# Filters the full output to show only input classification flags
# You should see ID_INPUT_TOUCHPAD=1 alongside other input flags
# If it is missing, check your file syntax and indentation

Open your desktop environment settings and navigate to the mouse or touchpad panel. The touchpad options should now appear. Test tap-to-click and two-finger scrolling. If the gestures work, the classification is correct. The desktop environment reads the udev properties at startup and when the device hotplugs. A running session may require a logout and login to refresh the input daemon.

Test gestures before you close the terminal. A working property flag does not guarantee the desktop environment loaded the new profile.

Common pitfalls and what the error looks like

The hardware database parser is strict. A single space in the wrong place breaks the rule. If you use spaces instead of tabs for indentation, the property line gets ignored. The device keeps its old classification. You will not see a terminal error. The rule simply fails silently.

Check the udev logs if the rule does not apply.

journalctl -xeu systemd-udevd
# Shows recent udev daemon activity with explanatory context
# Look for lines mentioning hwdb or property assignment
# The x flag adds human-readable hints to raw log entries

Another common mistake is using the wrong matching key. The touchpad:* prefix only works if the device reports a modalias containing that string. Some external trackpads report usb:v046DpB008* instead. You must match the actual modalias string. Run udevadm info --query=property --name=/dev/input/event7 | grep MODALIAS to find the correct prefix. Replace touchpad:* with the actual string plus an asterisk. The modalias format follows a strict vendor-product-revision pattern. Matching the first four characters is usually enough.

If you accidentally break the database syntax, udev will refuse to load the new index. You will see a warning in the journal.

systemd-udevd: Failed to update hwdb: Invalid syntax in /etc/udev/hwdb.d/50-touchpad.hwdb

The system falls back to the last known good database. Your touchpad remains misclassified. Fix the indentation, run sudo systemd-hwdb update again, and trigger the device. SELinux does not block hwdb updates. The daemon runs with the correct context by default. If you see permission denied errors, check the file ownership. It must be root:root with 644 permissions.

Check the modalias before you guess. A wrong prefix matches nothing, and nothing matches means no property assignment.

When to use hwdb vs libinput vs desktop settings

Use the udev hardware database when the kernel misclassifies the device entirely and desktop settings offer no touchpad panel. Use libinput configuration files when the device is recognized but needs sensitivity, acceleration, or gesture tweaks. Use desktop environment settings when you only want to toggle tap-to-click, natural scrolling, or pointer speed. Stick to the default kernel classification when the touchpad works out of the box and you do not need custom behavior.

Pick the lowest level that solves the problem. Desktop settings drift on updates. Hardware database rules persist.

Where to go next