hl.gesture¶
- hl.gesture(spec)¶
Register or remove a trackpad gesture.
Signature¶
hl.gesture(spec: HL.GestureSpec): nil
Parameters¶
- spec
HL.GestureSpec Gesture definition table.
Required fields¶
- fingersinteger
Number of fingers. Must be between
2and9.- directionstring
Gesture direction string. Parsed by Hyprland’s gesture manager.
- actionstring or function
Gesture action name or Lua callback function.
Accepted actions¶
workspaceWorkspace swipe gesture.
resizeResize gesture.
moveMove gesture.
specialSpecial workspace gesture. Uses
workspace_nameif provided.closeClose gesture.
floatFloat gesture. Uses
modeif provided.fullscreenFullscreen gesture. Uses
modeif provided.cursor_zoomorcursorZoomCursor zoom gesture. Uses
zoom_levelandmodeif provided.scroll_moveScroll-move gesture.
unsetRemove a matching gesture.
Optional fields¶
- modsstring, optional
Modifier string parsed as a Hyprland modifier mask.
- scalenumber, optional
Gesture delta scale. Must be between
0.1and10. Defaults to1.- modestring, optional
Action-specific mode string.
- zoom_levelstring, optional
Action-specific zoom level string.
- workspace_namestring, optional
Workspace name used by the
specialaction.- disable_inhibitboolean, optional
Disable inhibition handling for this gesture.
Returns¶
- nil
This function registers or removes the gesture and does not return a value.
Examples¶
hl.gesture({
fingers = 3,
direction = "horizontal",
action = "workspace",
})
hl.gesture({
fingers = 4,
direction = "down",
action = "special",
workspace_name = "scratch",
})
Lua callback action:
hl.gesture({
fingers = 3,
direction = "up",
action = function()
print("gesture")
end,
})
See also¶
HL.GestureSpecGesture table accepted by this function.