-
-
Notifications
You must be signed in to change notification settings - Fork 6
Features Input
Inject keyboard and mouse input into the desktop, and manage keyboard layout profiles.
Type a string of text at the current cursor position. Uses uinput or the desktop's virtual keyboard interface.
| Parameter | Type | Description |
|---|---|---|
text |
string | Text to type |
deskbrid input.keyboard_type "Hello, world!"{
"type": "input.keyboard_type",
"text": "Hello, world!"
}Press and release a single key.
| Parameter | Type | Description |
|---|---|---|
key |
string | Key name (e.g. a, Return, Escape, Tab, space) |
deskbrid input.keyboard_key Return
deskbrid input.keyboard_key Escape{
"type": "input.keyboard_key",
"key": "Return"
}Press a chord of keys simultaneously (modifier + key combos).
| Parameter | Type | Description |
|---|---|---|
keys |
string[] | List of key names, e.g. ["Ctrl", "c"]
|
deskbrid input.keyboard_combo '["Ctrl", "c"]'
deskbrid input.keyboard_combo '["Ctrl", "Shift", "Escape"]'
deskbrid input.keyboard_combo '["Alt", "Tab"]'{
"type": "input.keyboard_combo",
"keys": ["Ctrl", "c"]
}Perform a mouse action at a specific position, with optional button and scroll delta.
| Parameter | Type | Description |
|---|---|---|
action |
string |
click, double_click, right_click, move, scroll, press, release
|
x |
float? | Absolute X coordinate (optional) |
y |
float? | Absolute Y coordinate (optional) |
button |
string? |
left, middle, right (optional, default left) |
dx |
float? | Scroll delta X (for scroll action) |
dy |
float? | Scroll delta Y (for scroll action) |
deskbrid input.mouse '{"action": "move", "x": 500, "y": 300}'
deskbrid input.mouse '{"action": "click", "x": 500, "y": 300}'
deskbrid input.mouse '{"action": "right_click", "x": 500, "y": 300}'
deskbrid input.mouse '{"action": "scroll", "dy": -3}'
deskbrid input.mouse '{"action": "double_click", "x": 500, "y": 300}'{
"type": "input.mouse",
"action": "click",
"x": 500.0,
"y": 300.0,
"button": "left"
}Drag the mouse from one coordinate to another over a specified duration.
| Parameter | Type | Description |
|---|---|---|
from_x |
float | Starting X |
from_y |
float | Starting Y |
to_x |
float | Ending X |
to_y |
float | Ending Y |
button |
string? |
left (default), middle, right
|
duration_ms |
uint? | Drag duration in ms (default: 200) |
deskbrid input.mouse_drag '{"from_x": 100, "from_y": 100, "to_x": 500, "to_y": 300}'{
"type": "input.mouse_drag",
"from_x": 100.0,
"from_y": 100.0,
"to_x": 500.0,
"to_y": 300.0,
"button": "left",
"duration_ms": 200
}List all configured keyboard layouts.
deskbrid input.list_layoutsNo parameters.
Response:
{
"type": "response",
"status": "ok",
"data": [
{"index": 0, "name": "us", "variant": null},
{"index": 1, "name": "de", "variant": "neo"},
{"index": 2, "name": "us", "variant": "dvorak"}
]
}Get the currently active keyboard layout.
deskbrid input.get_layoutNo parameters.
Response:
{
"type": "response",
"status": "ok",
"data": {"index": 0, "name": "us", "variant": null}
}Switch to a different keyboard layout by index, name, or name+variant.
| Parameter | Type | Description |
|---|---|---|
index |
uint? | Layout index from list |
name |
string? | Layout name (e.g. us, de) |
variant |
string? | Layout variant (e.g. dvorak, neo) |
At least one of index or name is required. If both name and variant are
provided, switches to the matching layout.
deskbrid input.set_layout '{"index": 1}'
deskbrid input.set_layout '{"name": "de", "variant": "neo"}'{
"type": "input.set_layout",
"name": "de",
"variant": "neo"
}Add a new keyboard layout to the configuration.
| Parameter | Type | Description |
|---|---|---|
name |
string | Layout name (e.g. fr) |
variant |
string? | Layout variant (optional) |
deskbrid input.add_layout fr
deskbrid input.add_layout '{"name": "us", "variant": "colemak"}'{
"type": "input.add_layout",
"name": "us",
"variant": "colemak"
}Remove a keyboard layout by its index.
| Parameter | Type | Description |
|---|---|---|
index |
uint | Layout index to remove |
deskbrid input.remove_layout 2{
"type": "input.remove_layout",
"index": 2
}from deskbrid import Deskbrid
client = Deskbrid()
# Type text
client.input_keyboard_type("Hello from Deskbrid!\n")
# Send keyboard shortcut
client.input_keyboard_combo(["Ctrl", "c"])
# Click at a position
client.input_mouse(action="click", x=500, y=300)
# Drag across the screen
client.input_mouse_drag(from_x=100, from_y=100, to_x=500, to_y=300)
# Switch keyboard layout
layouts = client.input_list_layouts()
client.input_set_layout(index=(layouts[1]["index"] if len(layouts) > 1 else 0))-
X11: Uses Xtest / XSendEvent. Requires
xdotoolorlibxdo. -
Wayland: Requires the
uinputkernel module + write access to/dev/uinput. The install script sets up theuinputudev rule. - GNOME: Also supports the D-Bus virtual keyboard interface.
- Keyboard layout management requires
setxkbmap(X11) orgsettings/swaymsg(Wayland compositors).
- Input injection is a privileged operation. On most systems, the agent must
have the appropriate group membership (
inputgroup for uinput). - Confirmation mode may require explicit approval for keyboard input actions.
- Mouse coordinates use absolute screen coordinates — use
system.normalize_coordsif working with logical coordinates on mixed-DPI setups.
Stable — keyboard typing, key combos, mouse click/move/scroll. Experimental — mouse drag, keyboard layout management.
- Accessibility
- Apps
- Audio
- Backlight (LED driver)
- Bluetooth
- Clipboard
- Color Picker
- Desktop Portal
- Desktop Settings
- Files
- Hotkeys
- Input
- Keyboard Layouts
- Media (MPRIS)
- Monitors
- Network
- Notifications
- Print (CUPS)
- Screenshots
- Screen Recording
- Screencast
- Self-Update
- System
- System Tray
- Systemd Units & Timers
- Terminals (PTY)
- Windows & Workspaces