SDL mouse bug

Dear Sam,

There is a bug in SDL-0.8f src/SDL_mouse.c which causes all mouse
coordinates to be clipped against the edge of the display, even in
fullscreen mode. Please remove all edge clipping and also fix it so
we can fetch raw mouse deltas instead of having to deal with the
useless absolute coordinates.

KUTGW

David J. Beal

You will be able to get mouse deltas in SDL 0.9
There is still the problem with losing mouse events after the mouse has
moved out of the SDL window in a windowing environment.
Any ideas?

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

You will be able to get mouse deltas in SDL 0.9
There is still the problem with losing mouse events after the mouse has
moved out of the SDL window in a windowing environment.
Any ideas?

Well, if the problem is when the mouse moves out of the SDL window, why not just
trap the mouse inside the SDL window?On Mon, Sep 28, 1998 at 04:55:20PM -0700, Sam Lantinga wrote:


– Michael Samuel

But then how would you get the mouse out? Use CTRL+M or something?

Paul Lowe
xpaull at ultraviolet.org

michael at surfnetcity.com.au wrote:> On Mon, Sep 28, 1998 at 04:55:20PM -0700, Sam Lantinga wrote:

You will be able to get mouse deltas in SDL 0.9
There is still the problem with losing mouse events after the mouse has
moved out of the SDL window in a windowing environment.
Any ideas?

Well, if the problem is when the mouse moves out of the SDL window, why not just
trap the mouse inside the SDL window?


– Michael Samuel

Well, presumably their would be API functions that cover that. For one, the
SDL parachute could disable mouse trapping (or is it too late then??), and an
API function would enable/disable mouse trapping (eg. if it receives an event
of some sort, or at certain parts of you program, like the main menu).On Mon, Sep 28, 1998 at 08:56:30PM -0700, Paul Lowe wrote:

But then how would you get the mouse out? Use CTRL+M or something?


– Michael Samuel

There is still the problem with losing mouse events after the mouse has
moved out of the SDL window in a windowing environment.
Any ideas?

Well, if the problem is when the mouse moves out of the SDL window, why not just
trap the mouse inside the SDL window?

You still have the problem when the cursor reaches the edge of the window
– it can’t move any more, and you get no more mouse motion events.

The proper way to implement this is to keep track of the mouse, and when
it reaches the edge of the window, warp it back into the center of the window.
Of course, you keep the cursor hidden when you do this.

There’s a big problem with the BeOS API:
There’s no way to grab or warp the mouse.
I’ve reported it as a feature request, but their list is long and I don’t
think it will be fixed anytime soon.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

There’s a big problem with the BeOS API:
There’s no way to grab or warp the mouse.
I’ve reported it as a feature request, but their list is long and I don’t
think it will be fixed anytime soon.
I don’t want to nitpick…but…
That’s not exactly true.

set_mouse_position(int32 x, int32 y);
is a Miscellaneous global function in the Game Kit.
So presumably you can call it, initialize it to some point
in the BView that SDL is use, and track it and reset it.

David

There’s a big problem with the BeOS API:
There’s no way to grab or warp the mouse.
I’ve reported it as a feature request, but their list is long and I don’t
think it will be fixed anytime soon.
I don’t want to nitpick…but…
That’s not exactly true.

set_mouse_position(int32 x, int32 y);
is a Miscellaneous global function in the Game Kit.

I take it back. That’s exactly what SDL needs.
According to the documentation, it can only be used by an application using
the BDirectWindow API, which SDL doesn’t use yet. I’ll put it on the list
for 0.9

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

The proper way to implement this is to keep track of the mouse, and when
it reaches the edge of the window, warp it back into the center of the window.
Of course, you keep the cursor hidden when you do this.

Um, why not just reset the mouse position to the centre of the window each
time you read its position?

njhOn Tue, 29 Sep 1998, Sam Lantinga wrote:

The proper way to implement this is to keep track of the mouse, and when
it reaches the edge of the window, warp it back into the center of the window.
Of course, you keep the cursor hidden when you do this.

Um, why not just reset the mouse position to the centre of the window each
time you read its position?

grin That’s what I ended up doing in the new doom code.

That can actually be done from the SDL application – it doesn’t need to
be implemented in the library.

See ya!
-Sam Lantinga (slouken at devolution.com)> On Tue, 29 Sep 1998, Sam Lantinga wrote:


Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

There is still the problem with losing mouse events after the mouse has
moved out of the SDL window in a windowing environment.
Any ideas?

Well, if the problem is when the mouse moves out of the SDL window, why not just
trap the mouse inside the SDL window?

You still have the problem when the cursor reaches the edge of the window
– it can’t move any more, and you get no more mouse motion events.

Hmm… I forgot about that.

The proper way to implement this is to keep track of the mouse, and when
it reaches the edge of the window, warp it back into the center of the window.
Of course, you keep the cursor hidden when you do this.

Do you call that “The proper way”?!? It sounds pretty ugly to me:

  1. Doesn’t warping the cursor generate an event (as if you moved the mouse back
    to the center of the screen)? How do you know to ignore this specific event?

  2. You are putting limitations on how fast the mouse can move based on the
    size of the window.

  3. It’s a hack :wink:

There’s a big problem with the BeOS API:
There’s no way to grab or warp the mouse.
I’ve reported it as a feature request, but their list is long and I don’t
think it will be fixed anytime soon.

Well, that’s an excuse to find a good alternative to “The proper way” ;-)On Tue, Sep 29, 1998 at 11:53:11AM -0700, Sam Lantinga wrote:


– Michael Samuel

Do you call that “The proper way”?!? It sounds pretty ugly to me:

  1. Doesn’t warping the cursor generate an event (as if you moved the mouse back
    to the center of the screen)? How do you know to ignore this specific event?

Ignore any mouse motion event with the coordinates screen->w/2, screen->h/2

  1. You are putting limitations on how fast the mouse can move based on the
    size of the window.

Yep, Nathan was correct. The best way is to warp the mouse in response to
any mouse motion.

  1. It’s a hack :wink:

Yep.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/