@egjs/axes
Version:
A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.
33 lines (32 loc) • 1.69 kB
TypeScript
import { ExtendedEvent, InputEventType } from "../types";
export declare const SUPPORT_TOUCH: boolean;
export declare const SUPPORT_POINTER: boolean;
export declare const SUPPORT_MSPOINTER: boolean;
export declare const SUPPORT_POINTER_EVENTS: boolean;
export declare const isValidKey: (event: InputEventType | WheelEvent, inputKey?: string[]) => boolean;
export declare abstract class EventInput {
prevEvent: ExtendedEvent;
private _latestInterval;
abstract onEventStart(event: InputEventType, inputButton?: string[]): ExtendedEvent;
abstract onEventMove(event: InputEventType, inputButton?: string[]): ExtendedEvent;
abstract onEventEnd(event: InputEventType): void;
abstract onRelease(event: InputEventType): void;
abstract getTouches(event: InputEventType, inputKey?: string[], inputButton?: string[]): number;
protected abstract _getScale(event: InputEventType): number;
protected abstract _getCenter(event: InputEventType): {
x: number;
y: number;
};
protected abstract _getMovement(event: InputEventType): {
x: number;
y: number;
};
extendEvent(event: InputEventType): ExtendedEvent;
protected _getDistance(start: Touch | PointerEvent, end: Touch | PointerEvent): number;
protected _getButton(event: InputEventType): string;
protected _isTouchEvent(event: InputEventType): event is TouchEvent;
protected _isValidButton(button: string, inputButton: string[]): boolean;
protected _isValidEvent(event: InputEventType, inputKey?: string[], inputButton?: string[]): boolean;
protected _preventMouseButton(event: InputEventType, button: string): void;
private _stopContextMenu;
}