Tcl/tk: how to stop sdl from grabbing the pointer (windoze)

tcl/tk: how to stop sdl from grabbing the pointer (windoze)

Hi All!

I have a frame: “frame .view.canvas.sdlWindow -container 1” and use it’s
"winfo id .view.canvas.sdlWindow" to pass it on to SDL to use. All works
fine.

SDL is only used to redraw/expose the window’s content. I don’t want it
to interfere with my pointer, e.g.:

“bind .view.canvas.sdlWindow myproc” only calls myproc
occasionally. Most events seems to be consumed by SDL, although
I don’t have an SDL event loop, nor do I want any.

It works great on Linux but not on Windoze, does someone know how to do
this?

Thanks
Johan

Johan Knol wrote:

tcl/tk: how to stop sdl from grabbing the pointer (windoze)

Hi All!

I have a frame: “frame .view.canvas.sdlWindow -container 1” and use it’s
"winfo id .view.canvas.sdlWindow" to pass it on to SDL to use. All works
fine.

SDL is only used to redraw/expose the window’s content. I don’t want it
to interfere with my pointer, e.g.:

“bind .view.canvas.sdlWindow myproc” only calls myproc
occasionally. Most events seems to be consumed by SDL, although
I don’t have an SDL event loop, nor do I want any.

SDL_dibevents.c:DIB_CreateWindow() always registers WinMessage() as it’t
windows message processor. WinMessage() does all kind of things,
disregarding the state of e.g. SDL_ProcessEvents[SDL_MOUSEMOTION]. The
only thing I could think of is:

   /* DJM: we want all event's for the user specified
      window to be handled by SDL.
    */
   if (SDL_Window) {

#if 0 // JWK: I don’t
userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC);
SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage);
#endif
}

But there has to be a better way. Please comment.

Regards,
Johan