Changing mouse position from Pharo.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

stephane ducasse

On Mar 15, 2013, at 8:40 AM, stephane ducasse <[hidden email]> wrote:

> So add a bug entry for 3.0

I did it :)

>
> Stef
>
>>> There is device giving some values at the hardware level.
>>> Those things should of course be controllable from within the image.
>>> Are we going to let the hardware tell us what we can and cannot do? To
>>> hell with that :-p
>>>
>>
>> a simplest solution would be to add a primitive to VM, so you can set
>> the mouse cursor position..
>> I also find it strange that VM provides interface for changing the
>> cursor image/hide it.. but not setting its position.
>> See Cursor class.
>


Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

philippeback
In reply to this post by stephane ducasse
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.
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
>

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

stephane ducasse

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
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Nicolai Hess
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
>>
>



Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

stephane ducasse
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
>>
>




12