EventControllerScroll

gtk.event_controller_scroll.EventControllerScroll is an event controller that handles scroll events.

It is capable of handling both discrete and continuous scroll events from mice or touchpads, abstracting them both with the gtk.event_controller_scroll.EventControllerScroll.scroll signal. Deltas in the discrete case are multiples of 1.

In the case of continuous scroll events, gtk.event_controller_scroll.EventControllerScroll encloses all gtk.event_controller_scroll.EventControllerScroll.scroll emissions between two gtk.event_controller_scroll.EventControllerScroll.scroll and gtk.event_controller_scroll.EventControllerScroll.scroll signals.

The behavior of the event controller can be modified by the flags given at creation time, or modified at a later point through gtk.event_controller_scroll.EventControllerScroll.setFlags (e.g. because the scrolling conditions of the widget changed).

The controller can be set up to emit motion for either/both vertical and horizontal scroll events through gtk.types.EventControllerScrollFlags.Vertical, gtk.types.EventControllerScrollFlags.Horizontal and gtk.types.EventControllerScrollFlags.BothAxes. If any axis is disabled, the respective gtk.event_controller_scroll.EventControllerScroll.scroll delta will be 0. Vertical scroll events will be translated to horizontal motion for the devices incapable of horizontal scrolling.

The event controller can also be forced to emit discrete events on all devices through gtk.types.EventControllerScrollFlags.Discrete. This can be used to implement discrete actions triggered through scroll events (e.g. switching across combobox options).

The gtk.types.EventControllerScrollFlags.Kinetic flag toggles the emission of the gtk.event_controller_scroll.EventControllerScroll.decelerate signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.

Constructors

this
this(gtk.types.EventControllerScrollFlags flags)

Creates a new event controller that will handle scroll events.

Members

Functions

connectDecelerate
ulong connectDecelerate(T callback, Flag!"After" after)

Connect to Decelerate signal.

connectScroll
ulong connectScroll(T callback, Flag!"After" after)

Connect to Scroll signal.

connectScrollBegin
ulong connectScrollBegin(T callback, Flag!"After" after)

Connect to ScrollBegin signal.

connectScrollEnd
ulong connectScrollEnd(T callback, Flag!"After" after)

Connect to ScrollEnd signal.

getFlags
gtk.types.EventControllerScrollFlags getFlags()

Gets the flags conditioning the scroll controller behavior.

getUnit
gdk.types.ScrollUnit getUnit()

Gets the scroll unit of the last gtk.event_controller_scroll.EventControllerScroll.scroll signal received.

setFlags
void setFlags(gtk.types.EventControllerScrollFlags flags)

Sets the flags conditioning scroll controller behavior.

Inherited Members

From EventController

getCurrentEvent
gdk.event.Event getCurrentEvent()

Returns the event that is currently being handled by the controller.

getCurrentEventDevice
gdk.device.Device getCurrentEventDevice()

Returns the device of the event that is currently being handled by the controller.

getCurrentEventState
gdk.types.ModifierType getCurrentEventState()

Returns the modifier state of the event that is currently being handled by the controller.

getCurrentEventTime
uint getCurrentEventTime()

Returns the timestamp of the event that is currently being handled by the controller.

getName
string getName()

Gets the name of controller.

getPropagationLimit
gtk.types.PropagationLimit getPropagationLimit()

Gets the propagation limit of the event controller.

getPropagationPhase
gtk.types.PropagationPhase getPropagationPhase()

Gets the propagation phase at which controller handles events.

getWidget
gtk.widget.Widget getWidget()

Returns the gtk.widget.Widget this controller relates to.

reset
void reset()

Resets the controller to a clean state.

setName
void setName(string name)

Sets a name on the controller that can be used for debugging.

setPropagationLimit
void setPropagationLimit(gtk.types.PropagationLimit limit)

Sets the event propagation limit on the event controller.

setPropagationPhase
void setPropagationPhase(gtk.types.PropagationPhase phase)

Sets the propagation phase at which a controller handles events.

setStaticName
void setStaticName(string name)

Sets a name on the controller that can be used for debugging.