CCursor.h

Includes:
"LEOValue.h"
<functional>

Introduction

Use the links in the table of contents to the left to access the documentation.



Classes

__Stacksmith__CCursor__


Functions

GetGlobalPosition
Grab

GetGlobalPosition


static void GetGlobalPosition(
    LEONumber *outX,
    LEONumber *outY );  
Discussion

Return the current mouse position in coordinates relative to the upper left of the (main) screen.


Grab


static bool Grab(
    int mouseButtonNumber,
    std::function<bool(
            LEONumber x,
            LEONumber y,
            LEONumber pressure )> trackingHandler );  
Return Value

Returns whether the mouse ever moved or it was just a click or long hold.

Discussion

Synchronously track the mouse after a click until the mouse button is released again. Call us back whenever the mouse moves or the pressure changes. Button numbers are 0-based indexes: mouseButtonNumber == 0 is left, mouseButtonNumber == 1 is right, higher numbers mean other buttons. Coordinates are relative to the upper left of the (main) screen. If trackingHandler returns NO, tracking will be aborted.