Login  Register

Re: Changing mouse position from Pharo.

Posted by Igor Stasenko on Mar 14, 2013; 7:41pm
URL: https://forum.world.st/Changing-mouse-position-from-Pharo-tp4676580p4676817.html

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.