Hi,
Thursday, December 16, 2004, 11:00:17 PM, you wrote:
Hi,
file: SDL_sysevents.c
function: WinMessage
case WM_ACTIVATE: {
SDL_VideoDevice this = current_video;
BOOL minimized;
Uint8 appstate;
minimized = HIWORD(wParam);
if ( !minimized && (LOWORD(wParam) != WA_INACTIVE) ) {
/ Gain the following states */
appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS;
if ( this->input_grab != SDL_GRAB_OFF ) {
The last line must be:
if ( this->input_grab != SDL_GRAB_ON ) {
otherwise we never call WIN_GrabInput(this, SDL_GRAB_ON)
Must be? No.
Why do you know this?
I checked it in the debugger.
And you (presumably) discovered that the application wasn’t requesting
grabbing…
The fragment (this->>input_grab != SDL_GRAB_OFF) is a synomym for:
‘Is grabbing requested by the application?’.
No, it is a synonym for ‘when activate application please grab input
for me if it was not grabbed before by user’
Ah, I see. Have a look at this:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fWM_5fGrabInput
I quote:
“Grabbing means that the mouse is confined to the application window, and
nearly all keyboard input is passed directly to the application, and not
interpreted by a window manager, if any.”
The code you have highlighted allows the mouse out of a windowed
application when grabbing is on but the window is minimized, and then
captures the mouse again when the window is restored.
Grabbing is always requested by application that is why we have got
flags SDL_INIT_AUDIO and SDL_INIT_VIDEO and do not have flag like
SDL_INIT_INPUT.
I think you are confusing ‘grabbing’ with something else here.
I write SDL backend for PocketPC & WinCE and in GrabInput we are to
grab input because video system does not do it for us (like in
Windows). But pity, this function is never called by SDL.
It is called by SDL when the application enables grabbing by calling
SDL_WM_GrabInput(SDL_GRAB_ON).
I know nothing of the PocketPC & WinCE so I can’t be of any real use to
you, sorry. I’m only familiar with the windib/directx back-ends, but
found inspecting the others for comparison useful in understanding them.
Good luck with it,
best regards,
John.On Thu, Dec 16, 2004 at 11:40:37PM +0300, Dmitry Yakimov wrote:
On Wed, Dec 15, 2004 at 10:39:57PM +0300, Dmitry Yakimov wrote:
cheers, John Popplewell.
– Best regards, Dmitry Yakimov, ISDEF member ActiveKitten.com
_______________________________________________ SDL mailing list
SDL at libsdl.org http://www.libsdl.org/mailman/listinfo/sdl