Input
Configure libinput pointer devices globally or per-device — sweets.input.
sweets.input(...) configures physical libinput pointer devices.
On startup, on reload, and for newly connected devices, Sweets resets configurable fields to libinput defaults, applies the global block, then applies matching selector blocks in config order.
sweets.input({
accel_speed = 0.0,
})
sweets.input("touchpad", {
tap = true,
natural_scroll = true,
disable_while_typing = true,
})
sweets.input("mouse", {
natural_scroll = false,
accel_profile = "flat",
})
sweets.input("name:ELAN", {
accel_speed = -0.25,
})Selectors
Call sweets.input({ ... }) with no selector to target every device, or pass a
selector to target a subset.
| Selector | Matches |
|---|---|
pointer | Any physical libinput pointer device |
touchpad | Tapping-capable pointers, normally laptop touchpads |
mouse | Pointers not detected as touchpads |
name:TEXT | Case-insensitive device-name substring |
sweetctl inputs lists connected devices and pointer types. sweetctl input TEXT shows one device's supported, current, and default libinput settings.
This keeps natural scrolling on the touchpad only:
sweets.input({
accel_speed = 0.0,
})
sweets.input("touchpad", { natural_scroll = true })
sweets.input("mouse", { natural_scroll = false })Live tuning
Tune a setting without reloading:
sweetctl input ELAN accel_speed -0.25
sweetctl input ELAN natural_scroll true
sweetctl input "Logitech USB Optical Mouse" accel_profile flatSetting names and values match the options below. Changes are temporary — a
reload, reconnect, or restart resets them. Once a value feels right, add it to
the matching sweets.input(...) block.
Options
| Key | Type | Default | Description |
|---|---|---|---|
tap | bool | libinput | Enable tap-to-click |
tap_drag | bool | libinput | Enable tap-and-drag |
tap_drag_lock | bool | libinput | Enable tap-drag-lock |
natural_scroll | bool | libinput | Reverse scroll direction |
left_handed | bool | libinput | Swap left/right buttons |
middle_emulation | bool | libinput | Emulate middle click from left+right |
disable_while_typing | bool | libinput | Disable touchpad motion while typing |
accel_speed | number | libinput | Pointer acceleration, -1.0 to 1.0 |
accel_profile | string | libinput | adaptive or flat |
These settings are skipped for virtual pointers and non-libinput nested devices. Unsupported settings are ignored per device, so one block works across a mouse, touchpad, and trackpoint.