Input
Configure libinput pointer devices globally or per-device — sweets.input.
sweets.input(...) configures physical libinput pointer devices. On startup,
hot reload, and for newly connected devices, Sweets resets configurable fields to
libinput defaults, applies the global input 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
sweets.input(selector, { ... }) to target a subset:
| Selector | Matches |
|---|---|
pointer | Any physical libinput pointer device |
touchpad | Tapping-capable pointer devices, normally laptop touchpads and trackpads |
mouse | Pointer devices that are not detected as touchpads |
name:TEXT | Case-insensitive device-name substring |
Use sweetctl inputs to list connected input devices and pointer types.
Use sweetctl input TEXT to inspect one device's supported / current /
default libinput settings.
For example, this keeps natural scrolling only on the touchpad while the USB mouse keeps normal wheel direction:
sweets.input({
accel_speed = 0.0,
})
sweets.input("touchpad", { natural_scroll = true })
sweets.input("mouse", { natural_scroll = false })Live tuning
Use sweetctl input TEXT to inspect one unique device, then tune a setting
without reloading the configuration:
sweetctl input ELAN accel_speed -0.25
sweetctl input ELAN natural_scroll true
sweetctl input "Logitech USB Optical Mouse" accel_profile flatThe supported setting names and values are the same as the options below.
These changes are temporary: saving or reloading Lua, reconnecting the device,
or restarting Sweets resets it to the configured/default state. 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 when the device supports tapping |
tap_drag | bool | libinput | Enable tap-and-drag |
tap_drag_lock | bool | libinput | Enable libinput tap-drag-lock |
natural_scroll | bool | libinput | Reverse scroll direction for natural scrolling |
left_handed | bool | libinput | Swap left/right button behavior where supported |
middle_emulation | bool | libinput | Emulate middle click from left+right buttons where supported |
disable_while_typing | bool | libinput | Disable touchpad pointer motion while typing where supported |
accel_speed | number | libinput | Pointer acceleration speed, -1.0 to 1.0 |
accel_profile | string | libinput | Acceleration profile: adaptive or flat |
These settings are skipped for virtual pointers and non-libinput nested devices. Unsupported settings are ignored for that specific device, so the same block can be used across a mouse, touchpad, and trackpoint without breaking the session.