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
|

Changing mouse position from Pharo.

Santiago Bragagnolo
Hi all!

    I'm doing a bizarre experiment where i need to change the position of the mouse to a fixed point (like make the mouse pointer to jump from where it is to a button). Does anyone have a clue about how to?

 Thanks in advance!

Santiago
Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Carla F. Griggio
Hey!
Uff, yes. When Germán and I did this project: http://ss3.gemstone.com/ss/KinematicTemplates.html, we had to fight a lot with that.
Take a look at the code.

In the package KinematicTemplates-FFI there's a class Invokator that changes the cursor position at OS level:

Invokator(class)>>apiCGWarpMouseCursorPosition: aCGPoint
    "CGError CGWarpMouseCursorPosition(CGPoint newCursorPosition);"
    < apicall: void 'CGWarpMouseCursorPosition' ( CGPoint )  module: 'CoreGraphics.framework'>  
    ^ self externalCallFailed. 
  

And then, an example of usage:

Invokator apiCGWarpMouseCursorPosition: (CGPoint from: 30@30 ).

Tricky detail: if after evaluating that example you print World activeHand position, it will not be 30@30, so you also have to update the activeHand's position:

World activeHand position: 30@30.

Tell me if you need something else, or if this isn't really what you needed :P

Cheers,
Carla.





On Wed, Mar 13, 2013 at 12:28 PM, Santiago Bragagnolo <[hidden email]> wrote:
Hi all!

    I'm doing a bizarre experiment where i need to change the position of the mouse to a fixed point (like make the mouse pointer to jump from where it is to a button). Does anyone have a clue about how to?

 Thanks in advance!

Santiago

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

philippeback
In reply to this post by Santiago Bragagnolo
The InputEventSensor does some reading about that and at one point
updates the ActiveHand.

But it looks like we do read that from primitives. Not sure there is a
way to do that.
Interesting question!

Phil

2013/3/13 Santiago Bragagnolo <[hidden email]>:
> Hi all!
>
>     I'm doing a bizarre experiment where i need to change the position of
> the mouse to a fixed point (like make the mouse pointer to jump from where
> it is to a button). Does anyone have a clue about how to?
>
>  Thanks in advance!
>
> Santiago

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Carla F. Griggio
Yep, the first thing I tried when I had to deal with this was using InputEventSensor, but  I couldn't manage to use it for changing the mouse position.
As the InputEventSensor takes the position from the hardware cursor as you say, the workaround we found was actually changing the hardware cursor's position using FFI :P

Cheers,
Carla

On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]> wrote:
The InputEventSensor does some reading about that and at one point
updates the ActiveHand.

But it looks like we do read that from primitives. Not sure there is a
way to do that.
Interesting question!

Phil

2013/3/13 Santiago Bragagnolo <[hidden email]>:
> Hi all!
>
>     I'm doing a bizarre experiment where i need to change the position of
> the mouse to a fixed point (like make the mouse pointer to jump from where
> it is to a button). Does anyone have a clue about how to?
>
>  Thanks in advance!
>
> Santiago


Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

philippeback
This feature would be nice to have in the base system and not require FFI.

Glad you have an answer!

Phil

2013/3/13 Carla F. Griggio <[hidden email]>:

> Yep, the first thing I tried when I had to deal with this was using
> InputEventSensor, but  I couldn't manage to use it for changing the mouse
> position.
> As the InputEventSensor takes the position from the hardware cursor as you
> say, the workaround we found was actually changing the hardware cursor's
> position using FFI :P
>
> Cheers,
> Carla
>
> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
> wrote:
>>
>> The InputEventSensor does some reading about that and at one point
>> updates the ActiveHand.
>>
>> But it looks like we do read that from primitives. Not sure there is a
>> way to do that.
>> Interesting question!
>>
>> Phil
>>
>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>> > Hi all!
>> >
>> >     I'm doing a bizarre experiment where i need to change the position
>> > of
>> > the mouse to a fixed point (like make the mouse pointer to jump from
>> > where
>> > it is to a button). Does anyone have a clue about how to?
>> >
>> >  Thanks in advance!
>> >
>> > Santiago
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Santiago Bragagnolo
In reply to this post by Carla F. Griggio
Thank you Carla! :D.

I Agree Phil. It would be nice to have it in the system!


2013/3/13 Carla F. Griggio <[hidden email]>
Yep, the first thing I tried when I had to deal with this was using InputEventSensor, but  I couldn't manage to use it for changing the mouse position.
As the InputEventSensor takes the position from the hardware cursor as you say, the workaround we found was actually changing the hardware cursor's position using FFI :P

Cheers,
Carla


On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]> wrote:
The InputEventSensor does some reading about that and at one point
updates the ActiveHand.

But it looks like we do read that from primitives. Not sure there is a
way to do that.
Interesting question!

Phil

2013/3/13 Santiago Bragagnolo <[hidden email]>:
> Hi all!
>
>     I'm doing a bizarre experiment where i need to change the position of
> the mouse to a fixed point (like make the mouse pointer to jump from where
> it is to a button). Does anyone have a clue about how to?
>
>  Thanks in advance!
>
> Santiago



Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

stephane ducasse
In reply to this post by philippeback
could you explain what would be nice to have in the system?
We are slowly rewriting the event handling.

Stef

On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:

> This feature would be nice to have in the base system and not require FFI.
>
> Glad you have an answer!
>
> Phil
>
> 2013/3/13 Carla F. Griggio <[hidden email]>:
>> Yep, the first thing I tried when I had to deal with this was using
>> InputEventSensor, but  I couldn't manage to use it for changing the mouse
>> position.
>> As the InputEventSensor takes the position from the hardware cursor as you
>> say, the workaround we found was actually changing the hardware cursor's
>> position using FFI :P
>>
>> Cheers,
>> Carla
>>
>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
>> wrote:
>>>
>>> The InputEventSensor does some reading about that and at one point
>>> updates the ActiveHand.
>>>
>>> But it looks like we do read that from primitives. Not sure there is a
>>> way to do that.
>>> Interesting question!
>>>
>>> Phil
>>>
>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>>> Hi all!
>>>>
>>>>    I'm doing a bizarre experiment where i need to change the position
>>>> of
>>>> the mouse to a fixed point (like make the mouse pointer to jump from
>>>> where
>>>> it is to a button). Does anyone have a clue about how to?
>>>>
>>>> Thanks in advance!
>>>>
>>>> Santiago
>>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

philippeback
Being able to manage the cursor and not only be recipients of it.

For the event system, I understand that the at:1 at:2 .. thing may be
a tad "basic" but it has the advantage of being understandable. So I'd
keep it and then have an adaptation to something smarter.

Phil

2013/3/14 stephane ducasse <[hidden email]>:

> could you explain what would be nice to have in the system?
> We are slowly rewriting the event handling.
>
> Stef
>
> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>
>> This feature would be nice to have in the base system and not require FFI.
>>
>> Glad you have an answer!
>>
>> Phil
>>
>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>> Yep, the first thing I tried when I had to deal with this was using
>>> InputEventSensor, but  I couldn't manage to use it for changing the mouse
>>> position.
>>> As the InputEventSensor takes the position from the hardware cursor as you
>>> say, the workaround we found was actually changing the hardware cursor's
>>> position using FFI :P
>>>
>>> Cheers,
>>> Carla
>>>
>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
>>> wrote:
>>>>
>>>> The InputEventSensor does some reading about that and at one point
>>>> updates the ActiveHand.
>>>>
>>>> But it looks like we do read that from primitives. Not sure there is a
>>>> way to do that.
>>>> Interesting question!
>>>>
>>>> Phil
>>>>
>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>>>> Hi all!
>>>>>
>>>>>    I'm doing a bizarre experiment where i need to change the position
>>>>> of
>>>>> the mouse to a fixed point (like make the mouse pointer to jump from
>>>>> where
>>>>> it is to a button). Does anyone have a clue about how to?
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Santiago
>>>>
>>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

stephane ducasse

On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:

> Being able to manage the cursor and not only be recipients of it.

What do you mean exactly by that?
You want to be able to create event that move the cursor?
What is the scenario?


>
> For the event system, I understand that the at:1 at:2 .. thing may be
> a tad "basic"

No it is plain bad, promote duplication logic and cannot be used to create double dispatch

> but it has the advantage of being understandable. So I'd
> keep it and then have an adaptation to something smarter.
>
> Phil
>
> 2013/3/14 stephane ducasse <[hidden email]>:
>> could you explain what would be nice to have in the system?
>> We are slowly rewriting the event handling.
>>
>> Stef
>>
>> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>>
>>> This feature would be nice to have in the base system and not require FFI.
>>>
>>> Glad you have an answer!
>>>
>>> Phil
>>>
>>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>>> Yep, the first thing I tried when I had to deal with this was using
>>>> InputEventSensor, but  I couldn't manage to use it for changing the mouse
>>>> position.
>>>> As the InputEventSensor takes the position from the hardware cursor as you
>>>> say, the workaround we found was actually changing the hardware cursor's
>>>> position using FFI :P
>>>>
>>>> Cheers,
>>>> Carla
>>>>
>>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
>>>> wrote:
>>>>>
>>>>> The InputEventSensor does some reading about that and at one point
>>>>> updates the ActiveHand.
>>>>>
>>>>> But it looks like we do read that from primitives. Not sure there is a
>>>>> way to do that.
>>>>> Interesting question!
>>>>>
>>>>> Phil
>>>>>
>>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>>>>> Hi all!
>>>>>>
>>>>>>   I'm doing a bizarre experiment where i need to change the position
>>>>>> of
>>>>>> the mouse to a fixed point (like make the mouse pointer to jump from
>>>>>> where
>>>>>> it is to a button). Does anyone have a clue about how to?
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>> Santiago
>>>>>
>>>>
>>>
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Santiago Bragagnolo
I think this is not an event,

Some times you need to force the cursor to be in an other position, not in the current one. Maybe you just need to put the cursor over a component like button, or an area, just to guide the user.  Actually this is not an event, is just a low level service given by the operative system, that can be useful to have it.

Maybe a consistent way to do this can be that the same place that tell you over which point is the cursor now (The InputEventSensor in the current implementation) have also a setter that talk with the operative system, then you can have something like

mouseSensor position " it gives you the current position of the mouse "
mouseSensor position: 0@0. " it set the current position of the mouse, but not just in the sensor object, but in the operative system"





My scenario is bizarre, i was making experiments with a mouse as an odometry measure unit, and i need to avoid the cursor to reach the corners to keep taking different points in each measure.









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

On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:

> Being able to manage the cursor and not only be recipients of it.

What do you mean exactly by that?
You want to be able to create event that move the cursor?
What is the scenario?


>
> For the event system, I understand that the at:1 at:2 .. thing may be
> a tad "basic"

No it is plain bad, promote duplication logic and cannot be used to create double dispatch

> but it has the advantage of being understandable. So I'd
> keep it and then have an adaptation to something smarter.
>
> Phil
>
> 2013/3/14 stephane ducasse <[hidden email]>:
>> could you explain what would be nice to have in the system?
>> We are slowly rewriting the event handling.
>>
>> Stef
>>
>> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>>
>>> This feature would be nice to have in the base system and not require FFI.
>>>
>>> Glad you have an answer!
>>>
>>> Phil
>>>
>>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>>> Yep, the first thing I tried when I had to deal with this was using
>>>> InputEventSensor, but  I couldn't manage to use it for changing the mouse
>>>> position.
>>>> As the InputEventSensor takes the position from the hardware cursor as you
>>>> say, the workaround we found was actually changing the hardware cursor's
>>>> position using FFI :P
>>>>
>>>> Cheers,
>>>> Carla
>>>>
>>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
>>>> wrote:
>>>>>
>>>>> The InputEventSensor does some reading about that and at one point
>>>>> updates the ActiveHand.
>>>>>
>>>>> But it looks like we do read that from primitives. Not sure there is a
>>>>> way to do that.
>>>>> Interesting question!
>>>>>
>>>>> Phil
>>>>>
>>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>>>>> Hi all!
>>>>>>
>>>>>>   I'm doing a bizarre experiment where i need to change the position
>>>>>> of
>>>>>> the mouse to a fixed point (like make the mouse pointer to jump from
>>>>>> where
>>>>>> it is to a button). Does anyone have a clue about how to?
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>> Santiago
>>>>>
>>>>
>>>
>>
>>
>>
>



Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

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

Phil

2013/3/14 stephane ducasse <[hidden email]>:

>
> On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:
>
>> Being able to manage the cursor and not only be recipients of it.
>
> What do you mean exactly by that?
> You want to be able to create event that move the cursor?
> What is the scenario?
>
>
>>
>> For the event system, I understand that the at:1 at:2 .. thing may be
>> a tad "basic"
>
> No it is plain bad, promote duplication logic and cannot be used to create double dispatch
>
>> but it has the advantage of being understandable. So I'd
>> keep it and then have an adaptation to something smarter.
>>
>> Phil
>>
>> 2013/3/14 stephane ducasse <[hidden email]>:
>>> could you explain what would be nice to have in the system?
>>> We are slowly rewriting the event handling.
>>>
>>> Stef
>>>
>>> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>>>
>>>> This feature would be nice to have in the base system and not require FFI.
>>>>
>>>> Glad you have an answer!
>>>>
>>>> Phil
>>>>
>>>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>>>> Yep, the first thing I tried when I had to deal with this was using
>>>>> InputEventSensor, but  I couldn't manage to use it for changing the mouse
>>>>> position.
>>>>> As the InputEventSensor takes the position from the hardware cursor as you
>>>>> say, the workaround we found was actually changing the hardware cursor's
>>>>> position using FFI :P
>>>>>
>>>>> Cheers,
>>>>> Carla
>>>>>
>>>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
>>>>> wrote:
>>>>>>
>>>>>> The InputEventSensor does some reading about that and at one point
>>>>>> updates the ActiveHand.
>>>>>>
>>>>>> But it looks like we do read that from primitives. Not sure there is a
>>>>>> way to do that.
>>>>>> Interesting question!
>>>>>>
>>>>>> Phil
>>>>>>
>>>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>>>>>> Hi all!
>>>>>>>
>>>>>>>   I'm doing a bizarre experiment where i need to change the position
>>>>>>> of
>>>>>>> the mouse to a fixed point (like make the mouse pointer to jump from
>>>>>>> where
>>>>>>> it is to a button). Does anyone have a clue about how to?
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>> Santiago
>>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

philippeback
In reply to this post by Santiago Bragagnolo
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

/Phil

2013/3/14 Santiago Bragagnolo <[hidden email]>:

> I think this is not an event,
>
> Some times you need to force the cursor to be in an other position, not in
> the current one. Maybe you just need to put the cursor over a component like
> button, or an area, just to guide the user.  Actually this is not an event,
> is just a low level service given by the operative system, that can be
> useful to have it.
>
> Maybe a consistent way to do this can be that the same place that tell you
> over which point is the cursor now (The InputEventSensor in the current
> implementation) have also a setter that talk with the operative system, then
> you can have something like
>
> mouseSensor position " it gives you the current position of the mouse "
> mouseSensor position: 0@0. " it set the current position of the mouse, but
> not just in the sensor object, but in the operative system"
>
>
>
>
>
> My scenario is bizarre, i was making experiments with a mouse as an odometry
> measure unit, and i need to avoid the cursor to reach the corners to keep
> taking different points in each measure.
>
>
>
>
>
>
>
>
>
> 2013/3/14 stephane ducasse <[hidden email]>
>>
>>
>> On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:
>>
>> > Being able to manage the cursor and not only be recipients of it.
>>
>> What do you mean exactly by that?
>> You want to be able to create event that move the cursor?
>> What is the scenario?
>>
>>
>> >
>> > For the event system, I understand that the at:1 at:2 .. thing may be
>> > a tad "basic"
>>
>> No it is plain bad, promote duplication logic and cannot be used to create
>> double dispatch
>>
>> > but it has the advantage of being understandable. So I'd
>> > keep it and then have an adaptation to something smarter.
>> >
>> > Phil
>> >
>> > 2013/3/14 stephane ducasse <[hidden email]>:
>> >> could you explain what would be nice to have in the system?
>> >> We are slowly rewriting the event handling.
>> >>
>> >> Stef
>> >>
>> >> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>> >>
>> >>> This feature would be nice to have in the base system and not require
>> >>> FFI.
>> >>>
>> >>> Glad you have an answer!
>> >>>
>> >>> Phil
>> >>>
>> >>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>> >>>> Yep, the first thing I tried when I had to deal with this was using
>> >>>> InputEventSensor, but  I couldn't manage to use it for changing the
>> >>>> mouse
>> >>>> position.
>> >>>> As the InputEventSensor takes the position from the hardware cursor
>> >>>> as you
>> >>>> say, the workaround we found was actually changing the hardware
>> >>>> cursor's
>> >>>> position using FFI :P
>> >>>>
>> >>>> Cheers,
>> >>>> Carla
>> >>>>
>> >>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email]
>> >>>> <[hidden email]>
>> >>>> wrote:
>> >>>>>
>> >>>>> The InputEventSensor does some reading about that and at one point
>> >>>>> updates the ActiveHand.
>> >>>>>
>> >>>>> But it looks like we do read that from primitives. Not sure there is
>> >>>>> a
>> >>>>> way to do that.
>> >>>>> Interesting question!
>> >>>>>
>> >>>>> Phil
>> >>>>>
>> >>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>> >>>>>> Hi all!
>> >>>>>>
>> >>>>>>   I'm doing a bizarre experiment where i need to change the
>> >>>>>> position
>> >>>>>> of
>> >>>>>> the mouse to a fixed point (like make the mouse pointer to jump
>> >>>>>> from
>> >>>>>> where
>> >>>>>> it is to a button). Does anyone have a clue about how to?
>> >>>>>>
>> >>>>>> Thanks in advance!
>> >>>>>>
>> >>>>>> Santiago
>> >>>>>
>> >>>>
>> >>>
>> >>
>> >>
>> >>
>> >
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Igor Stasenko
On 14 March 2013 19:31, [hidden email] <[hidden email]> wrote:
> 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.

> /Phil
>
> 2013/3/14 Santiago Bragagnolo <[hidden email]>:
>> I think this is not an event,
>>
>> Some times you need to force the cursor to be in an other position, not in
>> the current one. Maybe you just need to put the cursor over a component like
>> button, or an area, just to guide the user.  Actually this is not an event,
>> is just a low level service given by the operative system, that can be
>> useful to have it.
>>
>> Maybe a consistent way to do this can be that the same place that tell you
>> over which point is the cursor now (The InputEventSensor in the current
>> implementation) have also a setter that talk with the operative system, then
>> you can have something like
>>
>> mouseSensor position " it gives you the current position of the mouse "
>> mouseSensor position: 0@0. " it set the current position of the mouse, but
>> not just in the sensor object, but in the operative system"
>>
>>
>>
>>
>>
>> My scenario is bizarre, i was making experiments with a mouse as an odometry
>> measure unit, and i need to avoid the cursor to reach the corners to keep
>> taking different points in each measure.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 2013/3/14 stephane ducasse <[hidden email]>
>>>
>>>
>>> On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:
>>>
>>> > Being able to manage the cursor and not only be recipients of it.
>>>
>>> What do you mean exactly by that?
>>> You want to be able to create event that move the cursor?
>>> What is the scenario?
>>>
>>>
>>> >
>>> > For the event system, I understand that the at:1 at:2 .. thing may be
>>> > a tad "basic"
>>>
>>> No it is plain bad, promote duplication logic and cannot be used to create
>>> double dispatch
>>>
>>> > but it has the advantage of being understandable. So I'd
>>> > keep it and then have an adaptation to something smarter.
>>> >
>>> > Phil
>>> >
>>> > 2013/3/14 stephane ducasse <[hidden email]>:
>>> >> could you explain what would be nice to have in the system?
>>> >> We are slowly rewriting the event handling.
>>> >>
>>> >> Stef
>>> >>
>>> >> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>>> >>
>>> >>> This feature would be nice to have in the base system and not require
>>> >>> FFI.
>>> >>>
>>> >>> Glad you have an answer!
>>> >>>
>>> >>> Phil
>>> >>>
>>> >>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>> >>>> Yep, the first thing I tried when I had to deal with this was using
>>> >>>> InputEventSensor, but  I couldn't manage to use it for changing the
>>> >>>> mouse
>>> >>>> position.
>>> >>>> As the InputEventSensor takes the position from the hardware cursor
>>> >>>> as you
>>> >>>> say, the workaround we found was actually changing the hardware
>>> >>>> cursor's
>>> >>>> position using FFI :P
>>> >>>>
>>> >>>> Cheers,
>>> >>>> Carla
>>> >>>>
>>> >>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email]
>>> >>>> <[hidden email]>
>>> >>>> wrote:
>>> >>>>>
>>> >>>>> The InputEventSensor does some reading about that and at one point
>>> >>>>> updates the ActiveHand.
>>> >>>>>
>>> >>>>> But it looks like we do read that from primitives. Not sure there is
>>> >>>>> a
>>> >>>>> way to do that.
>>> >>>>> Interesting question!
>>> >>>>>
>>> >>>>> Phil
>>> >>>>>
>>> >>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>> >>>>>> Hi all!
>>> >>>>>>
>>> >>>>>>   I'm doing a bizarre experiment where i need to change the
>>> >>>>>> position
>>> >>>>>> of
>>> >>>>>> the mouse to a fixed point (like make the mouse pointer to jump
>>> >>>>>> from
>>> >>>>>> where
>>> >>>>>> it is to a button). Does anyone have a clue about how to?
>>> >>>>>>
>>> >>>>>> Thanks in advance!
>>> >>>>>>
>>> >>>>>> Santiago
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >
>>>
>>>
>>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Carla F. Griggio
+1 to what Igor says.



On Thu, Mar 14, 2013 at 8:41 PM, Igor Stasenko <[hidden email]> wrote:
On 14 March 2013 19:31, [hidden email] <[hidden email]> wrote:
> 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.

> /Phil
>
> 2013/3/14 Santiago Bragagnolo <[hidden email]>:
>> I think this is not an event,
>>
>> Some times you need to force the cursor to be in an other position, not in
>> the current one. Maybe you just need to put the cursor over a component like
>> button, or an area, just to guide the user.  Actually this is not an event,
>> is just a low level service given by the operative system, that can be
>> useful to have it.
>>
>> Maybe a consistent way to do this can be that the same place that tell you
>> over which point is the cursor now (The InputEventSensor in the current
>> implementation) have also a setter that talk with the operative system, then
>> you can have something like
>>
>> mouseSensor position " it gives you the current position of the mouse "
>> mouseSensor position: 0@0. " it set the current position of the mouse, but
>> not just in the sensor object, but in the operative system"
>>
>>
>>
>>
>>
>> My scenario is bizarre, i was making experiments with a mouse as an odometry
>> measure unit, and i need to avoid the cursor to reach the corners to keep
>> taking different points in each measure.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 2013/3/14 stephane ducasse <[hidden email]>
>>>
>>>
>>> On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:
>>>
>>> > Being able to manage the cursor and not only be recipients of it.
>>>
>>> What do you mean exactly by that?
>>> You want to be able to create event that move the cursor?
>>> What is the scenario?
>>>
>>>
>>> >
>>> > For the event system, I understand that the at:1 at:2 .. thing may be
>>> > a tad "basic"
>>>
>>> No it is plain bad, promote duplication logic and cannot be used to create
>>> double dispatch
>>>
>>> > but it has the advantage of being understandable. So I'd
>>> > keep it and then have an adaptation to something smarter.
>>> >
>>> > Phil
>>> >
>>> > 2013/3/14 stephane ducasse <[hidden email]>:
>>> >> could you explain what would be nice to have in the system?
>>> >> We are slowly rewriting the event handling.
>>> >>
>>> >> Stef
>>> >>
>>> >> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>>> >>
>>> >>> This feature would be nice to have in the base system and not require
>>> >>> FFI.
>>> >>>
>>> >>> Glad you have an answer!
>>> >>>
>>> >>> Phil
>>> >>>
>>> >>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>> >>>> Yep, the first thing I tried when I had to deal with this was using
>>> >>>> InputEventSensor, but  I couldn't manage to use it for changing the
>>> >>>> mouse
>>> >>>> position.
>>> >>>> As the InputEventSensor takes the position from the hardware cursor
>>> >>>> as you
>>> >>>> say, the workaround we found was actually changing the hardware
>>> >>>> cursor's
>>> >>>> position using FFI :P
>>> >>>>
>>> >>>> Cheers,
>>> >>>> Carla
>>> >>>>
>>> >>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email]
>>> >>>> <[hidden email]>
>>> >>>> wrote:
>>> >>>>>
>>> >>>>> The InputEventSensor does some reading about that and at one point
>>> >>>>> updates the ActiveHand.
>>> >>>>>
>>> >>>>> But it looks like we do read that from primitives. Not sure there is
>>> >>>>> a
>>> >>>>> way to do that.
>>> >>>>> Interesting question!
>>> >>>>>
>>> >>>>> Phil
>>> >>>>>
>>> >>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>> >>>>>> Hi all!
>>> >>>>>>
>>> >>>>>>   I'm doing a bizarre experiment where i need to change the
>>> >>>>>> position
>>> >>>>>> of
>>> >>>>>> the mouse to a fixed point (like make the mouse pointer to jump
>>> >>>>>> from
>>> >>>>>> where
>>> >>>>>> it is to a button). Does anyone have a clue about how to?
>>> >>>>>>
>>> >>>>>> Thanks in advance!
>>> >>>>>>
>>> >>>>>> Santiago
>>> >>>>>
>>> >>>>
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >
>>>
>>>
>>
>



--
Best regards,
Igor Stasenko.


Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Igor Stasenko
On 14 March 2013 20:48, Carla F. Griggio <[hidden email]> wrote:
> +1 to what Igor says.
>
of course it is a big question what you going to "position" on iOS,
which having no any notion of mouse cursor at all.
But , of course, it doesn't means we should ignore traditional desktop
OSes which providing such interface.



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

philippeback
iOS supports a mouse cursor if you want to. Jailbroken iDevices have
that support w/ BT mice for example. It is just that they don't want
us to see it.
http://modmyi.com/content/8960-control-your-ios-device-bluetooth-mouse-trackpad-btc-mouse-trackpad.html

Furthermore, nothing preclude us from using the last touch for showing
a mouse cursor and on screen areas for red/yellow/blue

Phil


2013/3/14 Igor Stasenko <[hidden email]>:

> On 14 March 2013 20:48, Carla F. Griggio <[hidden email]> wrote:
>> +1 to what Igor says.
>>
> of course it is a big question what you going to "position" on iOS,
> which having no any notion of mouse cursor at all.
> But , of course, it doesn't means we should ignore traditional desktop
> OSes which providing such interface.
>
>
>
> --
> Best regards,
> Igor Stasenko.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

Ben Coman
In reply to this post by stephane ducasse
stephane ducasse wrote:

> On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:
>
>  
>> Being able to manage the cursor and not only be recipients of it.
>>    
>
> What do you mean exactly by that?
> You want to be able to create event that move the cursor?
> What is the scenario?
>  

Just brainstorming...
* Unit testing of the GUI - replaying clicks. Although this can probably
be done in image, this would test the lowest levels of event handling
and VM as well.
* Implementing something like http://www.autoitscript.com/site/autoit/


>
>  
>> For the event system, I understand that the at:1 at:2 .. thing may be
>> a tad "basic"
>>    
>
> No it is plain bad, promote duplication logic and cannot be used to create double dispatch
>
>  
>> but it has the advantage of being understandable. So I'd
>> keep it and then have an adaptation to something smarter.
>>
>> Phil
>>
>> 2013/3/14 stephane ducasse <[hidden email]>:
>>    
>>> could you explain what would be nice to have in the system?
>>> We are slowly rewriting the event handling.
>>>
>>> Stef
>>>
>>> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>>>
>>>      
>>>> This feature would be nice to have in the base system and not require FFI.
>>>>
>>>> Glad you have an answer!
>>>>
>>>> Phil
>>>>
>>>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>>>        
>>>>> Yep, the first thing I tried when I had to deal with this was using
>>>>> InputEventSensor, but  I couldn't manage to use it for changing the mouse
>>>>> position.
>>>>> As the InputEventSensor takes the position from the hardware cursor as you
>>>>> say, the workaround we found was actually changing the hardware cursor's
>>>>> position using FFI :P
>>>>>
>>>>> Cheers,
>>>>> Carla
>>>>>
>>>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
>>>>> wrote:
>>>>>          
>>>>>> The InputEventSensor does some reading about that and at one point
>>>>>> updates the ActiveHand.
>>>>>>
>>>>>> But it looks like we do read that from primitives. Not sure there is a
>>>>>> way to do that.
>>>>>> Interesting question!
>>>>>>
>>>>>> Phil
>>>>>>
>>>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>>>>>            
>>>>>>> Hi all!
>>>>>>>
>>>>>>>   I'm doing a bizarre experiment where i need to change the position
>>>>>>> of
>>>>>>> the mouse to a fixed point (like make the mouse pointer to jump from
>>>>>>> where
>>>>>>> it is to a button). Does anyone have a clue about how to?
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>> Santiago
>>>>>>>              
>>>
>>>      
>
>
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

stephane ducasse
In reply to this post by Santiago Bragagnolo
Ok I see and you want probably to scope it

during: [ ] setMousePoisitonTo: 

or something like that.

Stef


On Mar 14, 2013, at 6:45 PM, Santiago Bragagnolo <[hidden email]> wrote:

I think this is not an event,

Some times you need to force the cursor to be in an other position, not in the current one. Maybe you just need to put the cursor over a component like button, or an area, just to guide the user.  Actually this is not an event, is just a low level service given by the operative system, that can be useful to have it.

Maybe a consistent way to do this can be that the same place that tell you over which point is the cursor now (The InputEventSensor in the current implementation) have also a setter that talk with the operative system, then you can have something like

mouseSensor position " it gives you the current position of the mouse "
mouseSensor position: 0@0. " it set the current position of the mouse, but not just in the sensor object, but in the operative system"





My scenario is bizarre, i was making experiments with a mouse as an odometry measure unit, and i need to avoid the cursor to reach the corners to keep taking different points in each measure.









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

On Mar 14, 2013, at 5:14 PM, [hidden email] wrote:

> Being able to manage the cursor and not only be recipients of it.

What do you mean exactly by that?
You want to be able to create event that move the cursor?
What is the scenario?


>
> For the event system, I understand that the at:1 at:2 .. thing may be
> a tad "basic"

No it is plain bad, promote duplication logic and cannot be used to create double dispatch

> but it has the advantage of being understandable. So I'd
> keep it and then have an adaptation to something smarter.
>
> Phil
>
> 2013/3/14 stephane ducasse <[hidden email]>:
>> could you explain what would be nice to have in the system?
>> We are slowly rewriting the event handling.
>>
>> Stef
>>
>> On Mar 13, 2013, at 2:52 PM, [hidden email] wrote:
>>
>>> This feature would be nice to have in the base system and not require FFI.
>>>
>>> Glad you have an answer!
>>>
>>> Phil
>>>
>>> 2013/3/13 Carla F. Griggio <[hidden email]>:
>>>> Yep, the first thing I tried when I had to deal with this was using
>>>> InputEventSensor, but  I couldn't manage to use it for changing the mouse
>>>> position.
>>>> As the InputEventSensor takes the position from the hardware cursor as you
>>>> say, the workaround we found was actually changing the hardware cursor's
>>>> position using FFI :P
>>>>
>>>> Cheers,
>>>> Carla
>>>>
>>>> On Wed, Mar 13, 2013 at 2:25 PM, [hidden email] <[hidden email]>
>>>> wrote:
>>>>>
>>>>> The InputEventSensor does some reading about that and at one point
>>>>> updates the ActiveHand.
>>>>>
>>>>> But it looks like we do read that from primitives. Not sure there is a
>>>>> way to do that.
>>>>> Interesting question!
>>>>>
>>>>> Phil
>>>>>
>>>>> 2013/3/13 Santiago Bragagnolo <[hidden email]>:
>>>>>> Hi all!
>>>>>>
>>>>>>   I'm doing a bizarre experiment where i need to change the position
>>>>>> of
>>>>>> the mouse to a fixed point (like make the mouse pointer to jump from
>>>>>> where
>>>>>> it is to a button). Does anyone have a clue about how to?
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>> Santiago
>>>>>
>>>>
>>>
>>
>>
>>
>




Reply | Threaded
Open this post in threaded view
|

Re: Changing mouse position from Pharo.

stephane ducasse
In reply to this post by philippeback

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
In reply to this post by Igor Stasenko
So add a bug entry for 3.0

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.

12