35 lines
870 B
TypeScript
35 lines
870 B
TypeScript
|
import { BaseInput } from './base-input';
|
||
|
export declare class Mouse extends BaseInput {
|
||
|
private mousePosition;
|
||
|
private mouseDelta;
|
||
|
private mouseWheel;
|
||
|
private mouseButtons;
|
||
|
constructor(element: HTMLElement);
|
||
|
capture(): void;
|
||
|
release(): void;
|
||
|
getState(): IMouse;
|
||
|
private handleMouseDown;
|
||
|
private handleMouseMove;
|
||
|
private handleMouseUp;
|
||
|
private handlePointerChange;
|
||
|
}
|
||
|
export declare class Position {
|
||
|
x: number;
|
||
|
y: number;
|
||
|
}
|
||
|
export declare class MouseButtons {
|
||
|
keysDown: Map<number, boolean>;
|
||
|
keysJustPressed: Map<number, boolean>;
|
||
|
keysJustReleased: Map<number, boolean>;
|
||
|
}
|
||
|
export declare class Delta {
|
||
|
x: number;
|
||
|
y: number;
|
||
|
}
|
||
|
export interface IMouse {
|
||
|
mouseButtons: MouseButtons;
|
||
|
mousePosition: Position;
|
||
|
mouseWheel: Delta;
|
||
|
mouseDelta: Delta;
|
||
|
}
|