Results 1 to 4 of 4

Thread: Mouse leaves application window - how to detect?

  1. #1

    Default Mouse leaves application window - how to detect?

    Hi there,

    is there a way to tell whether the mouse has left the application window? Currently I'm having a problem when the user presses a mouse button, leaves the window, releases it and returns. This way I can't see the mouse up message and makes for a rather unpleasant user experience.

    I've also tried to capture the mouse, but this doesn't work at all, at least not under Windows 7. I'm using Clanlib 2.3.3.


  2. #2
    Join Date
    Nov 2011
    Little Rock, AR, USA


    First, I just started using ClanLib 2 days ago so don't listen to me ...with that said:

    I was just looking at the input example and it does something like this:

    CL_InputDevice &mouse = window.get_ic().get_mouse()
    CL_Point position = mouse.get_position();
    from that you can get the mouse x and y and check it against your window position and size (not sure how to get that just yet).

    You may also what to look at the sig_lost_focus () signal in CL_DisplayWindow

    I hope I'm not leading you down the wrong path, I just read your post yesterday and happened across this info today and thought I would share.


  3. #3
    ClanLib Developer
    Join Date
    Sep 2006
    Bergen, Norway


    I find it strange that capture_mouse does not work for your case. capture_mouse is being used by ClanGUI, and we are using this in an application currently, and it seems to work ok.

  4. #4


    Ok, I found a solution. Capturing the mouse only works until the window loses focus. So I just had to set up a slot for sig_focus_gained and call it there. Now it works as intended.

    Thank you guys!

Similar Threads

  1. Collision detect !
    By ahura_24 in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 06-16-2011, 07:11 PM
  2. How to : Delete/Close a Window and Center a Window ?
    By Fr3DBr in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 08-24-2009, 02:55 AM
  3. Freezing when mouse leaves CL_DisplayWindow
    By catch22 in forum Official ClanLib SDK Forums
    Replies: 31
    Last Post: 06-25-2009, 01:55 PM
  4. detect thread support
    By gergo in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 02-13-2009, 10:12 AM
  5. How to detect when the editor is opening?
    By Uhfgood in forum Novashell Game Creation System
    Replies: 1
    Last Post: 07-07-2008, 11:55 PM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts