-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//----------------------------------------------------------------------------- | ||
// name: mouse-cursor.ck | ||
// desc: quickly access the current Mouse cursor coordinates | ||
// (for full access to mouse input, see the Hid class) | ||
//----------------------------------------------------------------------------- | ||
// ALSO SEE mouse-abs.ck for absolute screen position | ||
// ALSO SEE mouse.ck for relative X Y deltas | ||
// | ||
// requires: chuck-1.5.4.2 or higher | ||
//----------------------------------------------------------------------------- | ||
|
||
// time loop | ||
while( true ) | ||
{ | ||
// get current XY mouse cursor absolute coordinates | ||
// as well as scaled coordinates (in [0,1]) | ||
// .xy() could return negative values for multi-monitor | ||
// .scaled() will always return values in [0,1] | ||
<<< MouseCursor.xy(), MouseCursor.scaled() >>>; | ||
|
||
// advance time | ||
25::ms => now; | ||
} |