SFML community forums

Help => Window => Topic started by: Redee on June 27, 2015, 12:42:43 pm

Title: winapi > ClipCursor(..) and window messages
Post by: Redee on June 27, 2015, 12:42:43 pm
Why checks m_mouseInside while getting WM_MOUSEMOVE message.
Its message we can get only if mouse cursor under rcClient of window.
And its saying mouse ABOVE render area of window.......
https://github.com/SFML/SFML/blob/2.3.x/src/SFML/Window/Win32/WindowImplWin32.cpp#L873
And here too > https://github.com/SFML/SFML/blob/2.3.x/src/SFML/Window/Win32/WindowImplWin32.cpp#L814

Ok I can modify and add variable to simply directly check this...

Maybe its my fault - some reset logic after WM_KILLFOCUS / WM_SETFOCUS....
Need to reenable ClipCursor(..) at >>
https://github.com/SFML/SFML/blob/2.3.x/src/SFML/Window/Win32/WindowImplWin32.cpp#L583

Yes... ))) Sry for panic )).

Need to do like this >>
case WM_SETFOCUS:
{
        // need to re-clipcursor to save clipcursor to borders of window
        if(mouseOut == false)
        {
                WINDOWINFO wiInfo;
                GetWindowInfo(getSystemHandle(), &wiInfo);
                ClipCursor(&wiInfo.rcClient);
        }

        Event event;
        event.type = Event::GainedFocus;
        pushEvent(event);
        break;
}
Title: Re: m_mouseInside and WM_MOUSEMOVE ?
Post by: Laurent on June 27, 2015, 01:44:04 pm
Your post is very very unclear.

Instead of starting with questions about the SFML code, can you please explain simply what your problem is, or what you want to tell us?
Title: Re: m_mouseInside and WM_MOUSEMOVE ?
Post by: Hapax on June 27, 2015, 03:51:58 pm
I don't know why you're going through SFML's implementation to pick apart things that you haven't even slightly researched. You seem to be under the impression that WM_MOUSEMOVE works the same way that SFML's MouseMove event does. I'm unsure where you got the impression that a window can't receive WM_MOUSEMOVE messages when outside of the client area.
Title: Re: m_mouseInside and WM_MOUSEMOVE ?
Post by: Redee on June 27, 2015, 06:11:01 pm
I said about re-ClipCursor and this logics drops after some window events.
Also I want say to re-ClipCursor after some messages like this >> WM_SIZE, WM_SETFOCUS, WM_EXITSIZEMOVE.

If you want save mouse cursor in window area ...