Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

mouse_scroll

Scroll the mouse wheel up or down with adjustable steps and optional coordinate targeting for desktop automation in Hyprland.

Instructions

Scroll the mouse wheel.

Args: direction: "up" or "down" amount: Number of scroll steps (default 3) x: X coordinate to scroll at (optional) y: Y coordinate to scroll at (optional)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionNodown
amountNo
xNo
yNo

Implementation Reference

  • The mouse_scroll tool handler that accepts direction, amount, and optional coordinates, triggering cursor movement if needed and then the scroll action.
    async def mouse_scroll(
        direction: str = "down",
        amount: int = 3,
        x: int | None = None,
        y: int | None = None,
    ) -> str:
        """Scroll the mouse wheel.
    
        Args:
            direction: "up" or "down"
            amount: Number of scroll steps (default 3)
            x: X coordinate to scroll at (optional)
            y: Y coordinate to scroll at (optional)
        """
        from . import input as inp
        if x is not None and y is not None:
            await inp.move_cursor(x, y)
        await inp.scroll(direction, amount)
  • The internal scroll helper function that uses ydotool to simulate the actual scroll event.
    async def scroll(direction: str = "down", amount: int = 3) -> None:
        """Scroll the mouse wheel using ydotool."""
        require_tool("ydotool")
        # ydotool mousemove --wheel: positive Y = down, negative Y = up
        y_val = amount if direction == "down" else -amount
        proc = await asyncio.create_subprocess_exec(
            "ydotool", "mousemove", "--wheel", "-x", "0", "-y", str(y_val),
            stdout=asyncio.subprocess.PIPE,
            stderr=asyncio.subprocess.PIPE,
        )
        _, stderr = await proc.communicate()
        if proc.returncode != 0:
            raise InputError(f"ydotool scroll failed: {stderr.decode().strip()}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alderban107/hyprland-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server