SDL c++ - While dragging a window I receave mousemotion events with wrong x,y values

Nibbie
Posts: 2
Joined: 2009.04
Post: #1
I'm using sdl to port a game from win32 to OSX.
when I dragg the game window, I keep receiving mousemotion events with wrong x,y values.
Any one have this beavior? Can I detect window dragging to ignore mousemotion events?

thanks in advanced
LC
Quote this message in a reply
Member
Posts: 63
Joined: 2005.12
Post: #2
Quote:I'm using sdl to port a game from win32 to OSX.
when I dragg the game window, I keep receiving mousemotion events with wrong x,y values.
Don't have an answer for you, but I've observed this behavior as well.

Fixing this is on the 'todo' list for the Mac version of my game though. If I manage to solve the problem (and if the question hasn't already been answered by then), I'll post back with whatever I find out.
Quote this message in a reply
Member
Posts: 63
Joined: 2005.12
Post: #3
I don't know if this will solve your problem, but you can determine at any time whether your app has mouse, input, and/or app focus using SDL_GetAppState() or by listening for 'active' events. When the window is being dragged your app will not have mouse focus, in which case you can just ignore the errant mouse motion events that are generated as the window is moved.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2009.04
Post: #4
_jyk_ Wrote:I don't know if this will solve your problem, but you can determine at any time whether your app has mouse, input, and/or app focus using SDL_GetAppState() or by listening for 'active' events. When the window is being dragged your app will not have mouse focus, in which case you can just ignore the errant mouse motion events that are generated as the window is moved.
It works for me Smile... thanks
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Carbon mouse events blocked by window events krex505 3 2,867 Sep 22, 2006 12:04 AM
Last Post: krex505