Mouse position: Difference between revisions

no edit summary
(add common lisp)
No edit summary
Line 731:
=={{header|Logo}}==
<lang logo>show mousepos ; [-250 250]</lang>
 
=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
Module Checkit {
\\ works when console is the active window
\\ pressing right mouse button exit the loop
While mouse<>2
Print mouse.x, mouse.y
End While
\\ end of part one, now we make a form with title Form1 (same name as the variable name)
Declare Form1 Form
Layer Form1 {
window 16, 10000,8000 ' 16pt font at maximum 10000 twips x 8000 twips
cls #335522, 1 \\ from 2nd line start the split screen (for form's layer)
pen 15 ' white
}
Function Form1.MouseMove {
Read new button, shift, x, y ' we use new because call is local, same scope as Checkit.
Layer Form1 {
print x, y, button
refresh
}
}
Function Form1.MouseDown {
Read new button, shift, x, y
\\ when we press mouse button we print in console
\\ but only the first time
print x, y, button
refresh
}
\\ open Form1 as modal window above console
Method Form1, "Show", 1
Declare Form1 Nothing
}
CheckIt
</lang>
 
 
=={{header|Mathematica}}==
Anonymous user