Re: Changing mouse position from Pharo.
Posted by
stephane ducasse on
Mar 16, 2013; 7:01pm
URL: https://forum.world.st/Changing-mouse-position-from-Pharo-tp4676580p4677041.html
We have to check because probably the design was violating basic notion of layering.
We do not want to have code that totally shortcut morphic.
Stef
Looking at the squeakvm source, there was a primitive for setting
the cursor position:
InputSensor>> cursorPoint: aPoint
"Set aPoint to be the current cursor location."
^self primCursorLocPut: aPoint
And
InputSensor>>primCursorLocPut: aPoint
"If the primitive fails, try again with a rounded point."
<primitive: 91>
^ self primCursorLocPutAgain: aPoint rounded
Curiosly nowadays the primitive 91 is used for testDisplayDepth,
so printing
InputSensor default cursorPoint:(100@100)
fails (returns self)
and
InputSensor default cursorPoint:31
or
InputSensor default cursorPoint:32
results in false or true
Pharo removed the #cursorPoint: selector.