Class: Gtk::GestureSwipe

Inherits:
GestureSingle show all
Defined in:
(unknown)

Instance Method Summary collapse

Methods inherited from GestureSingle

#button, #button=, #current_button, #current_sequence, #exclusive, #exclusive=, #exclusive?, #touch_only, #touch_only=, #touch_only?

Methods inherited from Gesture

#device, #get_bounding_box, #get_bounding_box_center, #get_last_event, #get_point, #get_sequence_state, #group, #handles_sequence, #is_active, #is_grouped_with, #is_recognized, #last_updated_sequence, #n_points, #n_points=, #sequences, #set_sequence_state, #state=, #ungroup

Methods inherited from EventController

#current_event, #current_event_device, #current_event_state, #current_event_time, #name, #name=, #propagation_limit, #propagation_limit=, #propagation_phase, #propagation_phase=, #reset, #static_name=, #widget, #widget=

Constructor Details

#initializeGtk::Gesture

Returns a newly created GtkGesture that recognizes swipes.

Instance Method Details

#get_velocity(velocity_x, velocity_y) ⇒ Boolean

Gets the current velocity.

If the gesture is recognized, this function returns true and fills in velocity_x and velocity_y with the recorded velocity, as per the last events processed.

Parameters:

  • velocity_x (Float)

    return value for the velocity in the X axis, in pixels/sec

  • velocity_y (Float)

    return value for the velocity in the Y axis, in pixels/sec

Returns:

  • (Boolean)

    whether velocity could be calculated