Skip to content

Commit e3bc20f

Browse files
committed
Regenerate arcane.d.ts with mouse button API
1 parent 26aadc2 commit e3bc20f

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

templates/default/types/arcane.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,43 @@ declare module "@arcane/runtime/rendering" {
884884
* @returns Mouse position in screen pixels.
885885
*/
886886
export declare function getMousePosition(): MousePosition;
887+
/**
888+
* Check if a mouse button is currently held down (returns true every frame while held).
889+
* Returns false in headless mode.
890+
*
891+
* Button numbers:
892+
* - 0 = Left mouse button
893+
* - 1 = Right mouse button
894+
* - 2 = Middle mouse button (wheel click)
895+
*
896+
* @param button - Mouse button number (0 = left, 1 = right, 2 = middle).
897+
* @returns true if the button is currently held down, false otherwise.
898+
*
899+
* @example
900+
* if (isMouseButtonDown(0)) {
901+
* // Left mouse button is held
902+
* }
903+
*/
904+
export declare function isMouseButtonDown(button: number): boolean;
905+
/**
906+
* Check if a mouse button was pressed this frame (transitioned from up to down).
907+
* Unlike {@link isMouseButtonDown}, this returns true only on the first frame the button is pressed.
908+
* Returns false in headless mode.
909+
*
910+
* Button numbers:
911+
* - 0 = Left mouse button
912+
* - 1 = Right mouse button
913+
* - 2 = Middle mouse button (wheel click)
914+
*
915+
* @param button - Mouse button number (0 = left, 1 = right, 2 = middle).
916+
* @returns true if the button was just pressed this frame, false otherwise.
917+
*
918+
* @example
919+
* if (isMouseButtonPressed(0)) {
920+
* // Left mouse button was just clicked
921+
* }
922+
*/
923+
export declare function isMouseButtonPressed(button: number): boolean;
887924
/**
888925
* Get the current viewport size in logical pixels (DPI-independent).
889926
* On a 2x Retina display with an 800x600 window, this returns `{ width: 800, height: 600 }`,

0 commit comments

Comments
 (0)