Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: winapi > ClipCursor(..) and window messages  (Read 2615 times)

0 Members and 1 Guest are viewing this topic.

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
winapi > ClipCursor(..) and window messages
« 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;
}
« Last Edit: June 27, 2015, 06:11:40 pm by Redee »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: m_mouseInside and WM_MOUSEMOVE ?
« Reply #1 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?
Laurent Gomila - SFML developer

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: m_mouseInside and WM_MOUSEMOVE ?
« Reply #2 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: m_mouseInside and WM_MOUSEMOVE ?
« Reply #3 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 ...