mouse_motion_to_scroll

mouse_motion_to_scroll changes mouse cursor movement to scroll wheel.

{
    "type": "mouse_motion_to_scroll",

    "from": {
        "modifiers": {
            "mandatory": [...],
            "optional": [...]
        }
    },

    "conditions": ...,

    "options": {
        "momentum_scroll_enabled": true,
        "speed_multiplier": 1.0
    }
}
Key Value Required Description
type "mouse_motion_to_scroll" Required
from.modifiers Same as basic.from.modifiers Optional Enable mouse_motion_to_scroll if specified modifiers are pressed
conditions Same as basic.conditions Optional Enable mouse_motion_to_scroll when specified conditions
options An object of parameters Optional

Options

Key Value Required Description
momentum_scroll_enabled true or false Optional Enable Momentum scroll. The default value is true.
speed_multiplier float value Optional Multiply scroll speed. The default value is 1.0.

Example

The following json changes button4 + mouse movement to scroll.

[
    {
        "type": "basic",
        "from": {
            "pointing_button": "button4",
            "modifiers": {
                "optional": ["any"]
            }
        },
        "to": [
            {
                "set_variable": {
                    "name": "enable_mouse_motion_to_scroll",
                    "value": 1
                }
            }
        ],
        "to_after_key_up": [
            {
                "set_variable": {
                    "name": "enable_mouse_motion_to_scroll",
                    "value": 0
                }
            }
        ]
    },
    {
        "type": "mouse_motion_to_scroll",
        "from": {
            "modifiers": {
                "optional": ["any"]
            }
        },
        "conditions": [
            {
                "type": "variable_if",
                "name": "enable_mouse_motion_to_scroll",
                "value": 1
            }
        ]
    }
]