Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

two-stroke-dragging

Arguments: window count x y dx-down dy-down dx-prev dy-prev spread-diff spread-factor first last

This generic function is called frequently while any fingers are in contact with a touchscreen on a two-stroke-mixin window (even while no fingers are moving). An application can provide methods on this generic function to handle certain kinds of gestures as they are being done. See the two-stroke-mixin class for more information.

A two-stroke-dragging method should return true if it handled the gesture, to override any default behavior. Default behavior would depend on what Microsoft does when a touch-event returns nil.

window is the two-stroke-mixin window where the gesture is being done.

count is an integer from 1 to 10 (inclusive) for the number of fingers that are currently in contact with the screen.

x and y are the integer coordinates of the current position of the first finger that made contact with the screen.

dx-down and dy-down are integers for the distance in pixels from the first finger's initial position to its current position. These coordinates would typically be used for smooth scrolling during the drag. Note that no "inertia" effect is provided for ending scrolling gradually after all fingers have left the screen; it is provided (by Microsoft) only with the gesture-event API.

dx-prev and dy-prev are integers for the distance in pixels from the first finger's position at the time of the previous call to two-stroke-dragging to its current position.

spread-diff will be nil except when two fingers are down, when it will be an integer for the number of pixels farther apart that the two fingers are than they were initially. This value and/or spread-factor would typically be used for smooth zooming during the drag.

spread-factor will be nil except when two fingers are down, when it will be a real number for the current distance between the two fingers divided by the initial distance between them.

first will be true when this is the first call to two-stroke-dragging for the current gesture, and otherwise will be nil. This is when the first finger has just made contact with the screen. If you maintain any state during the gesture that isn't provided by calls to two-stroke-dragging, you could initialize that state at this time.

last will be true when this is the last call to two-stroke-dragging for the current gesture, and otherwise will be nil. This is when the first finger that made contact for this gesture has just left the screen. If other fingers remain on the screen (and are possibly dragged farther), no futher calls to two-stroke-dragging will be made for this gesture (though two-stroke-gesture will be called only after all fingers have left the screen). If you need to finalize the continuous handling of this gesture using information that is passed here but not to two-stroke-gesture, you could do that at this time.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version