Not getting mouse-up events when mouse is outside plugin window

121 views
Skip to first unread message

John Dexter

unread,
Feb 9, 2011, 6:55:42 AM2/9/11
to firebre...@googlegroups.com
I noticed if I mouse-down on the plugin window and move the mouse outside this window before releasing the button, I don't receive the mouse-up event. Is this expected and unavoidable? It's proving a little irritating when using the mouse to control a camera in a 3D scene :)

NoAntzWk

unread,
Feb 9, 2011, 9:51:53 AM2/9/11
to firebre...@googlegroups.com
Hi, 

Well, I think it is a platform-dependent behavior. For windows platform you should manage onWindowsEvent() and take account for WM_SETFOCUS, WM_KILLFOCUS, WM_NCMOUSE*, WM_NCLBUTTON*, WM_NCRBUTTON*, WM_NCMBUTTON*, etc. messages.

Best regards.

John Dexter

unread,
Feb 9, 2011, 10:00:24 AM2/9/11
to firebre...@googlegroups.com
Are the generic event-handlers not considered too useful then? They were just used in my sample so I never figured to replace them.
Handling raw WM_ messages is possibly better suited to us anyway, to feed them into our existing UI libraries

Jarom Loveridge

unread,
Feb 9, 2011, 10:29:48 AM2/9/11
to firebre...@googlegroups.com, firebre...@googlegroups.com
In my experience the mouseup and mousedown events are handled as you describe in a wide array of applications, not just plugins. You may be able to handle mouse interaction more to your desires using the additional APIs mentioned.

Cheers,
Jarom Loveridge

Sorry about any typos, this message was sent from my phone.

Álvaro Martín

unread,
Feb 9, 2011, 10:57:56 AM2/9/11
to firebre...@googlegroups.com
For game issue you need to hide mouse pointer and use win32 api to make your mouse in the center of your plugin window.

Or when the mouse is outside of plugin window to right you put the mouse in left inside of plugin.

Is not a problem of FB, you need to manage that for every platform. It's a common issue

(iPhone)

Richard Bateman

unread,
Feb 9, 2011, 1:34:16 PM2/9/11
to firebre...@googlegroups.com

There is no reason that you couldn't do what you want with the generic handlers, but you'll still need to understand what is going on behind the scenes.  Windows simply stops giving us events when the mouse leaves the window unless you capture the cursor; there is a windows API call for that, but I don't know it off the top of my head.

Richard

pschellenbach

unread,
Feb 9, 2011, 6:43:12 PM2/9/11
to firebreath-dev
In Windows, use SetCapture(hwnd) to capture the mouse, and
ReleaseCapture() to release the capture. If you do a SetCapture in the
mouse-down handler, be sure to release it in the mouse-up. You may
want to check the coordinates in the mouse-up handler because they may
be outside of your plug-in window. Many native Windows controls have
this behaviour built in.

Pete
Reply all
Reply to author
Forward
0 new messages