Unbidden events with 1.1.8

It seems that when I run the program and the mouse cursor is positioned
over the newly created window, it receives a mouse move, a key down and
a key up event… This does not happen when I link against 1.1.6.

what key up/down? When the window loses focus, SDL generates key-up
events for all keys that are believed to be held down, and when
focus is regained the current state is queried and key-down events are
generated for pressed keys

there is an anomaly with locking keys on certain servers (XSun, maybe others)
but I haven’t bothered to solve that since all sensible people avoid
locking keys anyway :slight_smile:

Hello,

I’ve recently switched from SDL 1.1.6 to 1.1.8 and I now get some
strange behaviour with a little game I wrote.

It seems that when I run the program and the mouse cursor is positioned
over the newly created window, it receives a mouse move, a key down and
a key up event… This does not happen when I link against 1.1.6.

Also, there is no such problem when the mouse cursor is positioned
outside of the window when the game starts.

I’m using XFree 4.0.2 on Linux with glibc 2.1.3.

Does anyone have an idea what might be causing this?

Regards,
Jens

Moving the mouse and/or pressing keys. :slight_smile: Or are you getting this
information like this when the events haven’t actually occured? I.e. getting
mouse move events even though the you haven’t touched the mouse (maybe an
earthquake? :slight_smile: If you are getting normal events when the actions occur, then
all is normal. You should ignore any events that you aren’t specifically
interested in. It’s not correct to just assume you are only going to get
events you want and expect SDL to not send you other events.On Thursday 15 March 2001 02:04, you wrote:

Hello,

I’ve recently switched from SDL 1.1.6 to 1.1.8 and I now get some
strange behaviour with a little game I wrote.

It seems that when I run the program and the mouse cursor is positioned
over the newly created window, it receives a mouse move, a key down and
a key up event… This does not happen when I link against 1.1.6.

Also, there is no such problem when the mouse cursor is positioned
outside of the window when the game starts.

I’m using XFree 4.0.2 on Linux with glibc 2.1.3.

Does anyone have an idea what might be causing this?

It seems that when I run the program and the mouse cursor is positioned
over the newly created window, it receives a mouse move, a key down and
a key up event… This does not happen when I link against 1.1.6.

what key up/down? When the window loses focus, SDL generates key-up
events for all keys that are believed to be held down, and when
focus is regained the current state is queried and key-down events are
generated for pressed keys

Hm, yes, that should explain it. It’s code 13 (return). So my processor
is simply too fast, because I can’t manage to release the key before the
window opens up :wink:

What about that mouse move? I suppose, this created automatically as
well to position the cursor correctly. Is there a way to turn this
behaviour off, or do I have to empty to event queue before actually
starting my event loop?

Hm, yes, that should explain it. It’s code 13 (return). So my processor
is simply too fast, because I can’t manage to release the key before the
window opens up :wink:

I think this has been fixed (at least under X11) in more recent snapshots