Login  Register

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.


2013/3/15 stephane ducasse <[hidden email]>

On Mar 15, 2013, at 9:24 AM, [hidden email] wrote:

> Compared to your speed, I am an anemic snail Stef.
>
> Still, I am very interested in that area of which you showed me
> interesting internals.
>
> Curious about the double dispatch you want to do there. Tell me.

You can have a look at it on

http://smalltalkhub.com/#!/~Pharo/EventModel/packages/EventModel

we should continue to work on it. Fernando is using it since quite a moment :)

Stef

> Phil
>
> 2013/3/15 stephane ducasse <[hidden email]>:
>>
>> On Mar 14, 2013, at 7:29 PM, [hidden email] wrote:
>>
>>> About basic events, well Apple has internal events and the UIEvents.
>>> The internal events are basic and the UIEvents are user friendly an
>>> dppl can do double dispatch on them. These are two levels: one for the
>>> frameworks, and one for dealing with the low level.
>>>
>>> Anyway, I'd say a proper TextEditorMorph would be a priority over any
>>> event handling code…
>>
>> Alain will start to work on it and Athens will be pushed in 3.0 soon.
>> Now I work on what I can and learn slowly.
>>
>> Stef
>>
>