marceloeatworld/hyprland-ai-skill
hyprland
FlaggedThis skill should be used when the user asks about "Hyprland configuration", "hyprland.lua", "hyprland.conf", "Hyprland Lua config", "hyprctl", "Hyprland keybinds", "Hyprland window rules", "Hyprland monitors", "Hyprland dispatchers", "Hyprland animations", "Hyprland workspaces", "Hyprland IPC", "Hyprland plugins", "hyprlock", "hypridle", "hyprpaper", "hyprcursor", "hyprpicker", "hyprsunset", "xdg-desktop-portal-hyprland", "Hyprland on NixOS", "Hyprland Home Manager", "Hyprland layouts", "Hyprland dwindle", "Hyprland master layout", "Hyprland FAQ", "Hyprland performance", "Hyprland Nvidia", "Hyprland screen sharing", "Hyprland special workspace", "Hyprland smart gaps", "Hyprland multi-monitor", "Hyprland tearing", or any topic related to configuring, troubleshooting, or extending the Hyprland Wayland compositor and its ecosystem tools.
references/binds.md
View on GitHub<!-- source: https://wiki.hypr.land/configuring/core/binds -->
<!-- wiki commit: 41c7222 (2026-11-20 18:16:21 +0100) -->
<!-- auto-generated by scripts/generate-references.sh - DO NOT EDIT MANUALLY -->
# Hyprland Binds Reference
---
weight: 50
title: Binds
---
> [!WARNING]
> **Keybind handlers must not block.**
> Lua callbacks run on the compositor event loop.
> Avoid `io.popen`, network I/O, clipboard tools (`wl-paste`, `xclip`), sleeps, and other long-running work inside bind functions.
> Prefer `hl.dsp.exec_cmd(...)` for external commands so they run outside the bind callback.
> If you must probe the system from Lua, bound the wait (for example with `timeout`).
> A hung or slow call freezes input and the entire desktop until it returns.
> [!TIP]
> If you are unsure of what your key's name/keysym/keycode is, you can use [`wev`](https://github.com/jwrdegoede/wev) to find out.
## Basics
Basic syntax is:
```lua
hl.bind("keys", dispatcher or function(), { bind_flags })
```
The dispatcher list can be found in [Dispatchers](../dispatchers).
You can also supply a Lua function to your bind, if you prefer, and the bind will call it for you.
Bind flags are described [here](./flags).
{{% details title="Examples" closed="true" %}}
```lua
-- bind SUPER + SHIFT + Q to open Firefox
hl.bind("SUPER + SHIFT + Q", hl.dsp.exec_cmd("firefox"))
-- bind to an anonymous function with logic inside
hl.bind("SUPER + SHIFT + X", function()
-- more logic...
hl.dispatch(hl.dsp.window.float())
end)
```
{{% /details %}}
## Uncommon syms / binding with a keycode
See the [xkbcommon-keysyms.h header](https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h) for all the keysyms.
The name you should use is the segment after `XKB_KEY_`.
To bind a keycode, use the `code:` prefix before the key.
For example:
```lua
hl.bind("SUPER + code:28", hl.dsp.exec_cmd("amongus"))
```
will bind `SUPER + T`, since `T` is keycode 28.
## Binding modkeys only
<!-- NOTE: https://github.com/hyprwm/Hyprland/pull/15568 -->
To bind only a modkey, use the appropriate keysym name.
Usually it is a `MOD` key, suffixed with `_L` or `_R`.
When a keysym is used, the order in which keys are pressed matters because keys are no longer treated as modifiers.
{{% details title="Examples" closed="true" %}}
```lua
-- bind `amongus` to left alt
hl.bind("Alt_L", hl.dsp.exec_cmd("amongus"))
-- bind left super with left ctrl to open kitty
hl.bind("Super_L + Alt_L", hl.dsp.exec_cmd("kitty"))
-- bind left ctrl and right ctrl
hl.bind("Ctrl_L + Ctrl_R", hl.dsp.exec_cmd("kitty"))
-- bind super release to trigger only when not used as part of a key combo
hl.bind("Super_L", hl.dsp.exec_cmd("hyprlauncher -t"), { release = true })
```
{{% /details %}}
## Multiple binds to one key
> [!WARNING]
> The keybinds will be executed top to bottom, in the order they were written.
You can trigger multiple actions with the same keybind by using a Lua lambda function, which can then execute multiple dispatch calls:
```lua
-- To switch between windows in a floating workspace:
hl.bind("SUPER + Tab", function()
-- Change focus to another window
hl.dispatch(hl.dsp.window.cycle_next())
-- Bring it to the top
hl.dispatch(hl.dsp.window.alter_zorder({ mode = "top" }))
end)
```
## Unbind
To unbind a key, use `hl.unbind("key")` or assign it to a variable and use the `:unbind()` or `:remove()` methods on it.
The key in `hl.unbind` is case-sensitive and must exactly match the case of the `hl.bind` you are unbinding.
Unbind will remove all occurrences of the key that were registered before it.
{{% details title="Examples" closed="true" %}}
```lua
hl.bind("SUPER + TAB", hl.focus.workspace("e+1"))
hl.unbind("SUPER + Tab") -- this will NOT unbind
hl.unbind("SUPER + TAB") -- this will unbind
-- assign bind to "lft"
local moveLeft = hl.bind("SUPER + L", hl.dsp.window.move({ direction = "left" }) )
-- unbind "SUPER + L"
moveLeft:unbind()
-- or
moveLeft:remove()
```
{{% /details %}}
## XKB options
<!-- NOTE: maybe there is a better place for this thing, but i couldnt find it -->
To change the behavior of some keys, use `kb_options`.
To view all available options, run:
```sh
cat /usr/share/X11/xkb/rules/base.lst
```
{{% details title="Examples" closed="true" %}}
To remap Caps Lock to Ctrl:
```lua
hl.config({
input = {
kb_options = "ctrl:nocaps"
}
})
```
To swap Caps Lock and Escape:
```lua
hl.config({
input = {
kb_options = "caps:swapescape"
}
})
```
{{% /details %}}
## Binding quirks
<!-- NOTE: maybe there is a better place for this thing, but i couldnt find it -->
### Conditional bind resolution at bind time
When trying to create a bind with a condition inside it, you almost always want to wrap it in a function.
For example, this bind:
```lua
hl.bind("SUPER + L", hl.dsp.exec_cmd("foot", { float = not (hl.get_active_window().title == "foot") }) )
```
will be resolved to:
```lua
hl.bind("SUPER + L", hl.dsp.exec_cmd("foot", { float = false }) )
-- or, depending on your focus when config was reloaded
hl.bind("SUPER + L", hl.dsp.exec_cmd("foot", { float = true }) )
```
And it will stay like that until next config reload.
To make this act like you probably meant, the logic must be wrapped in a function:
```lua
hl.bind("SUPER + L", function()
local is_foot = hl.get_active_window().title == "foot"
hl.dispatch( hl.dsp.exec_cmd("foot", { float = not is_foot }) )
end)
```
Now the condition will be evaluated on each call of the bind, rather than only once at config load time.
### Auto-consuming binds and `return { ok = false }`
After executing a dispatcher, it can return an `ok` value to indicate whether it ran successfully.
When the `auto_consuming` flag is set, `hl.bind` checks that value to determine whether the keypress should be consumed or passed on.
{{% details title="Example" closed="true" %}}
```lua
hl.bind("p", function()
local window = hl.get_active_window()
if window and window.title == "some cool app" then
hl.dispatch(hl.dsp.exec_cmd("another_cool_app"))
else
return { ok = false }
end
end, { auto_consuming = true })
```
This bind will spawn `another_cool_app` if the active window's title is `"some cool app"`; otherwise it will pass `p` to the active window.
{{% /details %}}
### Binding to keys handled by systemd-logind
Normally, systemd-logind will handle hardware events such as the power button or lid switch.
While this can be disabled globally by editing its config file, a better option is to block that handling specifically while Hyprland is running.
This can be accomplished using `systemd-inhibit`.
For example, you might launch Hyprland via `systemd-inhibit --what=handle-power-key Hyprland`, and then create a bind to the relevant key event (`XF86PowerOff` in this case).
---
---
weight: 10
title: Flags
---
## Bind flags
`hl.bind()` supports flags in this format:
```lua
hl.bind(keys, dispatcher, { flag1 = true, flag2 = true })
```
For example:
```lua
hl.bind(keys, hl.dsp.exec_cmd("amongus"), { release = true, locked = true })
```
Available flags are:
| Flag | Description |
|------|-------------|
| `allow_input_capture` | When input is captured by a client, this bind will still be processed |
| `auto_consuming` | Key/mouse events will be passed to the active window if the dispatcher doesn't succeed |
| `device` | Allow binds to be set per device. See [Per-Device binds](../devices/per-device) |
| `description` | Will allow you to write a description for your bind |
| `dont_inhibit` | Bypasses the app's requests to inhibit keybinds |
| `drag` | Will trigger on release of a key or button as long as the mouse cursor moves outside `binds:drag_threshold` |
| `click` | Will trigger on release of a key or button as long as the mouse cursor stays inside `binds:drag_threshold` |
| `ignore_mods` | Will ignore modifiers |
| `locked` | Will also work when an input inhibitor (e.g. a lock screen) is active |
| `long_press` | Will trigger on long press of a key |
| `mouse`| See the dedicated [Mouse binds](../devices/mouse) section |
| `non_consuming` | Key/mouse events will be passed to the active window in addition to triggering the dispatcher |
| `release` | Will trigger on release of a key |
| `repeating` | Will repeat when held |
| `submap_universal` | Will be active no matter the submap |
| `transparent` | Cannot be shadowed by other binds |
{{% details title="Examples" closed="true" %}}
```lua
-- Close wofi if it's open, open it if it's not
hl.bind("Super_L", hl.dsp.exec_cmd("pkill wofi || wofi"), {release = true})
```
These binds set the expected behavior for regular keyboard media volume keys,
including when the screen is locked:
```lua
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), { repeating = true })
-- Example volume button that will activate even while an input inhibitor is active
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { repeating = true, locked = true })
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true })
-- Requires playerctl
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
-- Skip player on long press and only skip 5s on normal press
hl.bind("SUPER + XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { long_press = true })
hl.bind("SUPER + XF86AudioNext", hl.dsp.exec_cmd("playerctl position +5"))
```
{{% /details %}}
### Description
You can describe your keybind with the `description` flag.
Your description always goes in the flags section.
```lua
hl.bind(keys, dispatcher, { description = "Your description here"})
```
For example:
```lua
hl.bind("SUPER + Q", hl.dsp.exec_cmd("kitty"), { description = "Open my favourite terminal" })
```
If you want to access your binds' descriptions, see the returned bind object's `description` field, or use `hyprctl binds`.
For more information, have a look at [Using hyprctl](../../advanced-configuration/using-hyprctl).
---
---
weight: 50
title: Global hotkeys and binds
---
## Global Keybinds
### Classic
Yes, you heard that right, Hyprland does support global keybinds for _ALL_ apps, including OBS, Discord, Firefox, etc.
See the [`pass`](../../dispatchers) and [`send_shortcut`](../../dispatchers) dispatchers for keybinds.
Let's take OBS as an example: the "Start/Stop Recording" keybind is set to SUPER + F10, to make it work globally, simply add:
```lua
hl.bind("SUPER + F10", hl.dsp.pass({ window = [[class:com\.obsproject\.Studio]] }))
```
`pass` will pass the `PRESS` and `RELEASE` events by itself, no need for a `release` flag.
This also means that push-to-talk will work flawlessly with one `pass`, e.g.:
```lua
-- Pass MOUSE5 to TeamSpeak 3
hl.bind("mouse:276", hl.dsp.pass({ window = "class:TeamSpeak 3" }))
```
You may also add shortcuts, where other keys are passed to the window.
```lua
-- Send SUPER + F4 to OBS when SUPER + F10 is pressed.
hl.bind("SUPER + F10", hl.dsp.send_shortcut({ mods = "SUPER", key = "F4", window = "class:(TeamSpeak 3)" }))
```
> [!WARNING]
> This works flawlessly with all native Wayland applications.
> However, Xwayland is a bit wonky.
> Make sure that what you're passing is a "global Xorg keybind", otherwise passing from a different Xwayland app may not work.
### D-Bus global shortcuts
> [!NOTE]
> This function will _only_ work with [XDPH](../../../../hypr-ecosystem/user/xdg-desktop-portal-hyprland).
Some applications may already support the GlobalShortcuts portal in xdg-desktop-portal.
If that's the case, it's recommended to use the following method instead of `pass`:
Open your desired app and run `hyprctl globalshortcuts` in a terminal.
This will give you a list of currently registered shortcuts with their descriptions.
Choose whichever you like, for example `coolApp:myToggle`, and bind it to whatever you want with the `global` dispatcher:
```lua
hl.bind("SUPER + SHIFT + A", hl.dsp.global("coolApp:myToggle"))
```
The global shortcuts protocol can send both "activated" and "deactivated" events.
By default, the `global` dispatcher sends events based on the key input that triggered it.
For example, if used in a release bind, it will only send "deactivated" events, which your app may not respond to.
To override this and send a specific event, pass a boolean second argument to `global` (`true`/`false` for an activated/deactivated event, respectively).
---
---
weight: 40
title: Submaps
---
## Submaps
Keybind submaps allow you to activate a separate set of keybinds.
For example, if you want to enter a "resize mode" that allows you to resize windows with the arrow keys, you can do it like this:
```lua
-- Switch to a submap called `resize`.
hl.bind("ALT + R", hl.dsp.submap("resize"))
-- Start a submap called "resize".
hl.define_submap("resize", function()
-- Set repeating binds for resizing the active window.
hl.bind("right", hl.dsp.window.resize({ x = 10, y = 0, relative = true}), { repeating = true })
hl.bind("left", hl.dsp.window.resize({ x = -10, y = 0, relative = true}), { repeating = true })
hl.bind("up", hl.dsp.window.resize({ x = 0, y = 10, relative = true}), { repeating = true })
hl.bind("down", hl.dsp.window.resize({ x = 0, y = -10, relative = true}), { repeating = true })
-- Use `reset` to go back to the global submap
hl.bind("Escape", hl.dsp.submap("reset"))
end)
-- Keybinds further down will be global again...
```
> [!WARNING]
> Do not forget a keybind (`Escape`, in this case) to reset the keymap while inside it!
>
> If you get stuck inside a keymap, you can use `hyprctl dispatch 'hl.dsp.submap("reset")'` to go back.
> If you do not have a terminal open, open a new TTY and use the `--instance` flag to select which instance of Hyprland to operate on (if you only have one running this is 0).
> For example: `hyprctl dispatch --instance 0 'hl.dsp.submap("reset")'`.
You can also set the same keybind to perform multiple actions, such as resize and close the submap, like so:
```lua
hl.bind("ALT + R", hl.dsp.submap("resize"))
hl.define_submap("resize", function()
hl.bind("right", function()
hl.dispatch(hl.dsp.window.resize({ x = 10, y = 0, relative = true }))
hl.dispatch(hl.dsp.submap("reset"))
end)
end)
```
This works because the binds are executed in the order they appear, and assigning multiple actions per bind is possible.
You can set a keybind that will be active no matter the current submap with the submap universal bind flag.
```lua
hl.bind(mainMod .. " + K", hl.dsp.exec_cmd("kitty"), { submap_universal = true })
```
### Nesting
Submaps can be nested, see the following example:
```lua
hl.bind(mainMod .. " + M", hl.dsp.submap("main"))
hl.define_submap("main", function()
hl.bind("1", hl.dsp.submap("nested_one"))
hl.define_submap("nested_one", function()
hl.bind("SHIFT + Escape", hl.dsp.submap("reset"))
hl.bind("Escape", hl.dsp.submap("main_submap"))
hl.bind("2", hl.dsp.submap("nested_two"))
hl.define_submap("nested_two", function()
hl.bind("SHIFT + Escape", hl.dsp.submap("reset"))
hl.bind("Escape", hl.dsp.submap("main_submap"))
-- End of nested_two submap
end)
-- End of nested_one submap
end)
hl.bind("Escape", hl.dsp.submap("reset"))
-- End of main submap
end)
```
### Automatically close a submap on dispatch
Submaps can be automatically closed or sent to another submap, by providing either a submap name or `"reset"` as the second argument to `hl.define_submap()`.
```lua
hl.bind("SUPER + a", hl.dsp.submap("submapA"))
-- Sets the submap to submapB after pressing a.
hl.define_submap("submapA", "submapB", function()
hl.bind("a", hl.dsp.exec_cmd("someCoolThing.sh"))
end)
-- Reset submap to default after pressing a.
hl.dsp.submap("submapB", "reset", function()
hl.bind("a", hl.dsp.exec_cmd("someOtherCoolThing.sh"))
end)
```
### Catch-All
You can also define a keybind via the special `catchall` keyword, which activates no matter which key is pressed.
This can be used to prevent any keys from passing to your active application while in a submap or to exit it immediately when any unknown key is pressed:
```lua
hl.bind("catchall", hl.dsp.submap("reset"))
```
### Disabling keybinds with one master keybind
If you want to disable all keybinds with another keybind (making a keybind toggle of sorts), you can just use a submap with only a keybind to exit it.
```lua
hl.bind(KEYS, hl.dsp.submap("clean"))
hl.define_submap("clean", function()
hl.bind(KEYS, hl.dsp.submap("reset"))
end)
```
---
---
weight: 60
title: Switches
---
## Switches
> [!WARNING]
> Systemd-logind's `HandleLidSwitch` settings in `logind.conf` may conflict with Hyprland's laptop lid switch configurations.
> [!TIP]
> If you want to have switches operate as normal, but override them only when Hyprland is running, use `systemd-inhibit`.
> For example, you might launch Hyprland via `systemd-inhibit --what=handle-lid-switch Hyprland`, so that systemd-logind will ignore the switch while it is running.
Switches are useful for binding events like closing and opening a laptop's lid.
To view available switches, use `hyprctl devices`.
### Examples
```lua
-- Trigger when the switch is toggled.
hl.bind("switch:[switch name]", hl.dsp.exec_cmd("swaylock"), { locked = true })
-- Trigger when the switch is turning on.
hl.bind("switch:on:[switch name]", hl.dsp.exec_cmd("notify-send 'yooo'"), { locked = true })
-- Trigger when the switch is turning off.
hl.bind("switch:off:[switch name]", hl.dsp.exec_cmd("notify-send 'among us'"), { locked = true })
```
---
---
weight: 20
title: Keyboard layouts
---
## Switchable keyboard layouts
> [!WARNING]
> The first layout defined in the input section will be the one used for binds by default.
>
> For example: with `us,ua`, config binds would be e.g. `"SUPER + A"`, while on `ua,us` you'd have `"SUPER + Cyrillic_ef"`.
>
> You can change this behavior globally or per-device by setting `resolve_binds_by_sym = 1`.
> In that case, binds will activate when the symbol typed matches the symbol specified in the bind.
>
> For example: if your layouts are `us,fr` and you have a bind for `"SUPER + A"`, you'd need to press the first letter on the second row while the `us` layout is active, and the first letter on the first row while the `fr` layout is active.
### XKB
One of the methods to change the layout is to set XKB options, for example:
```lua
hl.config({
input = {
kb_layout = "us,cz",
kb_variant = ",qwerty",
kb_options = "grp:alt_shift_toggle"
}
})
```
Variants are set per layout, so the number and order of variants must match those of the layouts you want them to apply to.
### Hyprctl
You can also bind a key to execute `hyprctl switchxkblayout` for more keybind freedom.
See [Using hyprctl](../../advanced-configuration/using-hyprctl).
To find the valid layouts and `kb_options`, you can check out the `/usr/share/X11/xkb/rules/base.lst`.
For example, to get the layout name of a language:
```sh
grep -i 'persian' /usr/share/X11/xkb/rules/base.lst
```
To get the list of keyboard shortcuts you can put in the `kb_options` to toggle keyboard layouts:
```sh
grep 'grp:.*toggle' /usr/share/X11/xkb/rules/base.lst
```
## Misc
### Workspace bindings on non-QWERTY layouts
Keys used for keybinds must be accessible on your keyboard layout without any modifiers.
For example, the [French AZERTY](https://en.wikipedia.org/wiki/AZERTY) layout uses SHIFT + _`unmodified key`_ to write `0-9` numbers.
As such, the keybinds for this layout need to use the names of the _unmodified keys_ , and will not work when using the `0-9` numbers.
> [!NOTE]
> To get the correct name for an `unmodified_key`, refer to [the section on uncommon syms](..#uncommon-syms--binding-with-a-keycode).
There are a few ways of solving this:
1. using a keycode;
1. using the generic key name.
#### Keycodes
You can bind a key by its keycode using the `code:int` syntax.
Keys from 1–0 are mapped to codes 10–19, respectively.
For example, `1` is `code:10`.
#### Generic key name
To get generic key name, you need to read XKB file for your layout.
For example, French layout is located in `/usr/share/X11/xkb/symbols/fr` file, and has the following names:
```plain
1 — ampersand
2 — eacute
3 — quotedbl
4 — apostrophe
5 — parenleft
6 — egrave
7 — minus
8 — underscore
9 — ccedilla
0 — agrave
```
---
---
weight: 30
title: Device binds
---
This section contains the following pages:
{{< subpage_list >}}
---
---
weight: 30
title: Per-device binds
---
## Per-Device Binds
You can set keybinds to be device specific with the `device` flag.
This flag is a table consisting of an `inclusive` flag and device list.
If `inclusive` is set to true, only devices specified in the list are capable of triggering the keybind.
If set to false, all devices except those specified can trigger the keybind.
If `inclusive` is not present, it defaults to true.
A list of devices is specified in the `list` field as a comma separated list of strings.
Device tags (set via a [per-device config](../../../devices)) may also be used in place of device names.
### Examples
```lua
hl.bind(keys, dispatcher(params), { device = { inclusive = true, list = { "device1", "device2" } } })
```
```lua
-- Only example-keyboard-1 can use this bind
hl.bind("SUPER + Q", hl.dsp.exec_cmd("kitty"), { device = { inclusive = true, list = { "example-keyboard-1" } } })
-- Every keyboard other than razer-keyboard and asus-keyboard can use this bind
hl.bind("SUPER + Q", hl.dsp.exec_cmd("kitty"), { device = { inclusive = false, list = { "razer-keyboard", "asus-keyboard" } } })
```
You can check device names with `hyprctl devices`.
---
---
weight: 10
title: Mouse
---
> [!NOTE]
> Mouse binds, despite their name, behave like normal binds.
> You are free to use whatever keys/mods you please.
> When they are held, the mouse function will be activated, and you can then press the relevant mouse button.
## Mouse buttons
You can bind mouse buttons by prefixing a keycode with `mouse:`.
Common mouse button key codes (check `wev` for other buttons) are:
- Left Mouse Button: 272
- Right Mouse Button: 273
- Middle Mouse Button: 274
```lua
-- Bind SUPER + LMB to launch kitty terminal.
hl.bind("SUPER + mouse:272", hl.dsp.exec_cmd("kitty"))
```
## Movement
Some dispatchers rely on mouse movement and need to have `mouse` flag set to `true`
<!-- TODO: unify with dispatchers page -->
| Name | Description |
| ---- | ----------- |
| `window.drag()` | moves the active window |
| `window.resize()` | resizes the active window |
| `window.resize({ keep_aspect_ratio })` | resizes the active window, overriding the window’s keep_aspect_ratio prop temporarily |
`binds.drag_threshold` config option can be used to differentiate between clicks and drags with the same button:
```lua
hl.config({
binds {
-- Fire a drag event only after dragging for more than 10px
drag_threshold = 10
}
})
-- ALT + LMB: Move a window by dragging more than 10px.
hl.bind("ALT + mouse:272", hl.dsp.window.drag(), { mouse = true })
-- ALT + LMB (click): Floats a window by clicking
hl.bind("ALT + mouse:272", hl.dsp.window.float(), { click = true })
-- ALT + LMB: Resizes a window by dragging
hl.bind("ALT + mouse:273", hl.dsp.window.resize(), { mouse = true })
```
You can also bind mouse wheel events with `mouse_up` and `mouse_down` (or `mouse_left` and `mouse_right` if your mouse supports horizontal scrolling):
```lua
hl.bind("SUPER + mouse_down", hl.dsp.focus({ workspace = "e-1" }))
```
> [!NOTE]
> There is a cooldown between consecutive scroll events.
> You can control this with the `binds.scroll_event_delay` config value.
---
---
weight: 20
title: Touchpad
---
## Touchpad
As clicking and moving the mouse on a touchpad is unergonomic, you can also use keyboard keys instead of mouse clicks.
```lua
hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind("SUPER + CTRL_L", hl.dsp.window.drag(), { mouse = true })
hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouse = true })
hl.bind("SUPER + ALT_L", hl.dsp.window.resize(), { mouse = true })
```
---
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |