Skip to content

Gdk.ScrollEvent

class — extends Event

An event related to a scrolling motion.

Methods

get_deltas

def get_deltas(self) -> tuple[float, float]

Extracts the scroll deltas of a scroll event.

The deltas will be zero unless the scroll direction is ScrollDirection.SMOOTH.

For the representation unit of these deltas, see ScrollEvent.get_unit.

get_direction

def get_direction(self) -> ScrollDirection

Extracts the direction of a scroll event.

get_relative_direction

def get_relative_direction(self) -> ScrollRelativeDirection

Extracts the scroll direction relative to the physical motion.

get_unit

def get_unit(self) -> ScrollUnit

Extracts the scroll delta unit of a scroll event.

The unit will always be ScrollUnit.WHEEL if the scroll direction is not ScrollDirection.SMOOTH.

is_stop

def is_stop(self) -> bool

Check whether a scroll event is a stop scroll event.

Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity.

Stop scroll events always have a delta of 0/0.