UNPKG

@eclipse-scout/core

Version:
35 lines 1.59 kB
/// <reference types="jquery" /> import MouseDownEvent = JQuery.MouseDownEvent; export interface DoubleClickSupportOptions { /** * Maximum time in milliseconds between two consecutive mousedown events to consider as a double * click event. If the interval is larger than this value, doubleClicked() will return false. Default is 500. */ maxDoubleClickInterval?: number; /** * Maximum distance (in all directions in pixels) between two consecutive mousedown events to consider as * a double click event. If the distance is larger than this value, doubleClicked() will return false. Default is 10. */ maxDoubleClickDistance?: number; } /** * Simple helper to determine if two consecutive 'mousedown' events should be considered as a double click. * * How to use: * 1. Feed all mousedown events to the mousedown() method. * 2. The method doubleClicked() returns true if the two last added events happened so fast after * each other that hey should be considered a 'double click'. If the distance or interval between * the last two events is too large, false is returned. */ export declare class DoubleClickSupport { protected _lastPosX: number; protected _lastPosY: number; protected _lastTimestamp: number; protected _maxDoubleClickInterval: number; protected _maxDoubleClickDistance: number; protected _doubleClicked: boolean; constructor(options?: DoubleClickSupportOptions); mousedown(event: MouseDownEvent): void; doubleClicked(): boolean; } //# sourceMappingURL=DoubleClickSupport.d.ts.map