Gdk.ScrollEvent

g Gdk.Event Gdk.Event Gdk.ScrollEvent Gdk.ScrollEvent Gdk.Event->Gdk.ScrollEvent

Subclasses:

None

Methods

Inherited:

Gdk.Event (17)

get_deltas ()

get_direction ()

get_unit ()

is_stop ()

Virtual Methods

None

Fields

None

Class Details

class Gdk.ScrollEvent
Bases:

Gdk.Event

Abstract:

No

An event related to a scrolling motion.

get_deltas()[source]
Returns:

delta_x:

return location for x scroll delta

delta_y:

return location for y scroll delta

Return type:

(delta_x: float, delta_y: float)

Extracts the scroll deltas of a scroll event.

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

For the representation unit of these deltas, see [method`Gdk`.ScrollEvent.get_unit].

get_direction()[source]
Returns:

the scroll direction of self

Return type:

Gdk.ScrollDirection

Extracts the direction of a scroll event.

get_unit()[source]
Returns:

the scroll unit.

Return type:

Gdk.ScrollUnit

Extracts the scroll delta unit of a scroll event.

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

New in version 4.8.

is_stop()[source]
Returns:

True if the event is a scroll stop event

Return type:

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.