Changing mouse position from Pharo.
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
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 < santiagobragagnolo@gmail.com> 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
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 <santiagobragagnolo@gmail.com>:
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
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, phil@highoctane.be <phil@highoctane.be>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 <santiagobragagnolo@gmail.com>:
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
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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
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 <stephane.ducasse@free.fr>
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be < phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
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 <santiagobragagnolo@gmail.com>:
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 <stephane.ducasse@free.fr>
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
On 14 March 2013 19:31, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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 <stephane.ducasse@free.fr>
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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.
+1 to what Igor says. On Thu, Mar 14, 2013 at 8:41 PM, Igor Stasenko <siguctua@gmail.com> wrote:
On 14 March 2013 19:31, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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 <stephane.ducasse@free.fr>
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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.
On 14 March 2013 20:48, Carla F. Griggio <carla.griggio@gmail.com> 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.
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-track... 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 <siguctua@gmail.com>:
On 14 March 2013 20:48, Carla F. Griggio <carla.griggio@gmail.com> 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.
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.
On Mar 15, 2013, at 8:40 AM, stephane ducasse <stephane.ducasse@free.fr> 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.
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 <santiagobragagnolo@gmail.com> 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 <stephane.ducasse@free.fr>
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
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 <stephane.ducasse@free.fr>:
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
On Mar 14, 2013, at 7:29 PM, phil@highoctane.be 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
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 <stephane.ducasse@free.fr>:
On Mar 14, 2013, at 7:29 PM, phil@highoctane.be 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
On Mar 15, 2013, at 9:24 AM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
On Mar 14, 2013, at 7:29 PM, phil@highoctane.be 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
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 <stephane.ducasse@free.fr>
On Mar 15, 2013, at 9:24 AM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
On Mar 14, 2013, at 7:29 PM, phil@highoctane.be 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
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 <stephane.ducasse@free.fr>
On Mar 15, 2013, at 9:24 AM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
On Mar 14, 2013, at 7:29 PM, phil@highoctane.be 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
stephane ducasse wrote:
On Mar 14, 2013, at 5:14 PM, phil@highoctane.be 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 <stephane.ducasse@free.fr>:
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, phil@highoctane.be 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 <carla.griggio@gmail.com>:
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, phil@highoctane.be <phil@highoctane.be> 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 <santiagobragagnolo@gmail.com>:
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
Thank you Carla! :D. I Agree Phil. It would be nice to have it in the system! 2013/3/13 Carla F. Griggio <carla.griggio@gmail.com>
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, phil@highoctane.be <phil@highoctane.be>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 <santiagobragagnolo@gmail.com>:
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
participants (7)
-
Ben Coman -
Carla F. Griggio -
Igor Stasenko -
Nicolai Hess -
phil@highoctane.be -
Santiago Bragagnolo -
stephane ducasse