Debian Codegraph @

examples/hid/mouse-cursor.ck

raw
1 //-----------------------------------------------------------------------------
2 // name: mouse-cursor.ck
3 // desc: quickly access the current Mouse cursor coordinates
4 // (for full access to mouse input, see the Hid class)
5 //-----------------------------------------------------------------------------
6 // ALSO SEE mouse-abs.ck for absolute screen position
7 // ALSO SEE mouse.ck for relative X Y deltas
8 //
9 // requires: chuck-1.5.4.2 or higher
10 //-----------------------------------------------------------------------------
11
12 // time loop
13 while( true )
14 {
15 // get current XY mouse cursor absolute coordinates
16 // as well as scaled coordinates (in [0,1])
17 // .xy() could return negative values for multi-monitor
18 // .scaled() will always return values in [0,1]
19 <<< MouseCursor.xy(), MouseCursor.scaled() >>>;
20
21 // advance time
22 25::ms => now;
23 }