Class: Gdk::ScrollEvent

Inherits:
Event
  • Object
show all
Defined in:
(unknown)

Overview

An event related to a scrolling motion.

Instance Method Summary collapse

Methods inherited from Event

#_get_angle, #_get_center, #_get_distance, #device, #device_tool, #display, #event_sequence, #event_type, #get_axes, #get_axis, #get_history, #get_position, #modifier_state, #pointer_emulated, #ref, #seat, #surface, #time, #triggers_context_menu, #unref

Instance Method Details

#directionGdk::ScrollDirection

Extracts the direction of a scroll event.

Returns:

#get_deltas(delta_x, delta_y) ⇒ nil

Extracts the scroll deltas of a scroll event.

The deltas will be zero unless the scroll direction is %GDK_SCROLL_SMOOTH.

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

Parameters:

  • delta_x (Float)

    return location for x scroll delta

  • delta_y (Float)

    return location for y scroll delta

Returns:

  • (nil)

#is_stopBoolean

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.

Returns:

  • (Boolean)

    true if the event is a scroll stop event

#unitGdk::ScrollUnit

Extracts the scroll delta unit of a scroll event.

The unit will always be %GDK_SCROLL_UNIT_WHEEL if the scroll direction is not %GDK_SCROLL_SMOOTH.

Returns: