Grabbing the mouse

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

Grabbing the mouse

Tapple Gao
Is there a way in squeak to completely grab the mouse so you can
get all events, and not even bother with the cursor? a lot of
games do it for various features, and trying to do the same in
Open Cobalt for the camera controls

--
Matthew Fulmer (a.k.a. Tapple)

Reply | Threaded
Open this post in threaded view
|

Re: Grabbing the mouse

Bert Freudenberg
No.  I think we used platform-specific FFI calls for that, but can't remember the details.

- Bert -

On 12.02.2011, at 05:46, Matthew Fulmer <[hidden email]> wrote:

> Is there a way in squeak to completely grab the mouse so you can
> get all events, and not even bother with the cursor? a lot of
> games do it for various features, and trying to do the same in
> Open Cobalt for the camera controls
>
> --
> Matthew Fulmer (a.k.a. Tapple)
>

Reply | Threaded
Open this post in threaded view
|

Re: Grabbing the mouse

Tapple Gao
In reply to this post by Tapple Gao
On Fri, Feb 11, 2011 at 11:46:04PM -0500, Matthew Fulmer wrote:
> Is there a way in squeak to completely grab the mouse so you can
> get all events, and not even bother with the cursor? a lot of
> games do it for various features, and trying to do the same in
> Open Cobalt for the camera controls

I discovered that there is InputSensor >> cursorPoint: that
claims to move the mouse pointer position, but the primitive
seems to be un-implemented on all three platforms.

To try it:

Sensor cursorPoint: 100@100

--
Matthew Fulmer (a.k.a. Tapple)

Reply | Threaded
Open this post in threaded view
|

Re: Grabbing the mouse

Tapple Gao
In reply to this post by Tapple Gao
On Fri, Feb 11, 2011 at 11:46:04PM -0500, Matthew Fulmer wrote:
> Is there a way in squeak to completely grab the mouse so you can
> get all events, and not even bother with the cursor? a lot of
> games do it for various features, and trying to do the same in
> Open Cobalt for the camera controls

I discovered that there is InputSensor >> cursorPoint: that
claims to move the mouse pointer position, but the primitive
seems to be un-implemented on all three platforms.

To try it:

Sensor cursorPoint: 100@100

--
Matthew Fulmer (a.k.a. Tapple)

Reply | Threaded
Open this post in threaded view
|

Re: Grabbing the mouse

Bert Freudenberg
In reply to this post by Tapple Gao

On 21.02.2011, at 15:41, Matthew Fulmer wrote:

> On Fri, Feb 11, 2011 at 11:46:04PM -0500, Matthew Fulmer wrote:
>> Is there a way in squeak to completely grab the mouse so you can
>> get all events, and not even bother with the cursor? a lot of
>> games do it for various features, and trying to do the same in
>> Open Cobalt for the camera controls
>
> I discovered that there is InputSensor >> cursorPoint: that
> claims to move the mouse pointer position, but the primitive
> seems to be un-implemented on all three platforms.
>
> To try it:
>
> Sensor cursorPoint: 100@100
>
> --
> Matthew Fulmer (a.k.a. Tapple)


won't fix

http://bugs.squeak.org/view.php?id=2406

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Grabbing the mouse

Levente Uzonyi-2
In reply to this post by Tapple Gao
On Mon, 21 Feb 2011, Matthew Fulmer wrote:

> On Fri, Feb 11, 2011 at 11:46:04PM -0500, Matthew Fulmer wrote:
>> Is there a way in squeak to completely grab the mouse so you can
>> get all events, and not even bother with the cursor? a lot of
>> games do it for various features, and trying to do the same in
>> Open Cobalt for the camera controls
>
> I discovered that there is InputSensor >> cursorPoint: that
> claims to move the mouse pointer position, but the primitive
> seems to be un-implemented on all three platforms.
>
> To try it:
>
> Sensor cursorPoint: 100@100

It uses primitive 91, but that doesn't change the cursor position anymore:
(91 primitiveTestDisplayDepth) "Blue Book: primitiveCursorLocPut"

You can do it with FFI calls. On windows it's:

setCursorPosX: x y: y

  <apicall: bool 'SetCursorPos' (long long) module: 'user32.dll'>
  ^self externalCallFailed

Note that x and y are absolute values, not relative to the current window.


Levente

>
> --
> Matthew Fulmer (a.k.a. Tapple)
>
>