Skip to content

Mousewheel Control

Nikita Yudin edited this page Dec 28, 2023 · 1 revision

Description

Mousewheel control module adds useful methods to control mousewheel input.

Properties

Let's look on list of all available properties:

Name Type Default Description
initialized bool false Whether the mousewheel control is initialized.
enabled bool false Whether the mousewheel control is enabled.
invert bool false Set to true to invert switching direction.
input_handled bool true Stops the input from propagating further down the SceneTree. If true then does not allow scrolling in ScrollContainer.
release_on_edges bool false Set to true and will release mousewheel event and allow page scrolling when on edge positions (in the beginning or in the end).

Methods

After we initialize we have its initialized instance in variable with helpful methods:

Name Return Description
initialize(viewport: Viewport) void Initialize mousewheel control.
disable() void Disable mousewheel control.
enable() void Enable mousewheel control.
set_edges(edge_start: bool, edge_end: bool) void Set to true and will release input event and allow page left/right when on edge positions (in the beginning or in the end).
input(event: InputEvent) void Called when there is an input event.

Signals

Name Description
scrolled(event: InputEvent) Event is triggered when the mouse wheel is scrolled.
prev_input Event is triggered when mousewheel is scrolled to enter previous value.
next_input Event is triggered when mousewheel is scrolled to enter next value.

Enumerations

enum MousewheelTargets:

Name Value Description
ALL 0 Switching with the mouse wheel is triggered across the entire surface.
VALUE 1 Switching with the mouse wheel takes place only on the value surface.