Skip to content

gnoblin.configure.input.touchpad ​

Set only the touchpad behavior you want to override. Unspecified fields keep their current GNOME/Mutter values. Changes apply on configuration reload. This example enables tap-to-click and two-finger scrolling:

lua
gnoblin.configure {
    input = {
        touchpad = {
            tap_to_click = true,
            two_finger_scrolling_enabled = true,
        },
    },
}

Pointer behavior ​

FieldAccepted valuesWhat it changes
speedNumber from -1 to 1-1 is unaccelerated, 1 is fast, and 0 uses the system default.
scroll_speedNumber from 0 to 2Scales two-finger and touchpad scrolling. 1 is the default speed, 0.5 is half speed, and 2 is twice the speed.
accel_profile"default", "flat", or "adaptive"Uses the device default, a constant pointer speed, or acceleration based on movement speed.
left_handed"right", "left", or "mouse"Selects the touchpad button order; "mouse" follows the mouse setting.
natural_scrollBooleanReverses the scroll direction.

Gestures ​

FieldAccepted valuesMeaning
tap_to_clickBooleanClick by tapping the touchpad.
tap_and_dragBooleanDrag by tapping, then moving a finger.
tap_and_drag_lockBooleanKeep a tap-and-drag active briefly after lifting your finger.
disable_while_typingBooleanHelps prevent pointer movement from a resting palm while typing.
edge_scrolling_enabledBooleanScroll along the touchpad edge, if supported.
two_finger_scrolling_enabledBooleanScroll by moving two fingers, if supported.

Click mapping ​

FieldAccepted valuesMeaning
tap_button_map"default", "lrm", or "lmr""lrm" maps one-, two-, and three-finger taps to left, right, and middle click. "lmr" swaps the two- and three-finger mappings.
click_method"default", "none", "areas", or "fingers"Keep hardware behavior, disable software-emulated clicks, or emulate clicks using click areas or finger counts.

Each field defaults to the current device preference when omitted. The "default" enum value asks GNOME/libinput to choose the device behavior.

Use the Lua event API to change speed for the window under the pointer. This also works when the pointer window has not taken keyboard focus:

lua
gnoblin.on("pointer_window_changed", function(event)
    local speed = event.app_id == "org.chromium.Chromium" and 0.3 or 1.0
    gnoblin.configure {input = {touchpad = {scroll_speed = speed}}}
end)

The callback table includes app_id, wm_class, and title. See the Lua event API for other event names and payloads.

The available gestures depend on the touchpad hardware. GNOME's touchpad guide explains tap, click, and scroll behavior. The libinput acceleration guide describes the adaptive and flat profiles.

Type definition ​

This is schema pseudocode in Lua table form. ? marks an optional field; | separates accepted alternatives.

lua
gnoblin.configure {
    input = {
        touchpad = {
            speed = number?, -- -1 to 1
            scroll_speed = number?, -- 0 to 2
            accel_profile = "default" | "flat" | "adaptive"?,
            left_handed = "right" | "left" | "mouse"?,
            natural_scroll = boolean?,
            tap_to_click = boolean?,
            tap_and_drag = boolean?,
            tap_and_drag_lock = boolean?,
            disable_while_typing = boolean?,
            edge_scrolling_enabled = boolean?,
            two_finger_scrolling_enabled = boolean?,
            tap_button_map = "default" | "lrm" | "lmr"?,
            click_method = "default" | "none" | "areas" | "fingers"?,
        },
    },
}