IDirectInputDevice8 mouse - when to acquire/unacquire problems
From
R.Wieser@21:1/5 to
All on Fri Nov 4 09:55:05 2022
Hello all,
I've create a small DirectX program in which I (ofcourse) use the mouse to point my way in. It runs in a simple dialog (no controls). I think I've
got the graphics side down.
But it turns out that the when to acquire / unacquire the mouse is ... problematic.
For starters, I initially put them into the WM_SETFOCUS and WM_KILLFOCUS
events of the dialog. It turns out that when restoring the dialog (from a minimized state) the acquire of the mouse seems to be ignored (no error though).
So, I tried to use the WM_ACTIVATE event instead, and as far as I can tell
it works (the reason I'm describing this is that I would not mind to get a
hint on what the commonly used method is, as my time using ddg/brave/google have not turned anything up in that regard).
Secondly, although I can use F10 to "uncapture" the mouse (added code to the WM_ENTERMENULOOP and WM_EXITMENULOOP events to release and re-acquire the mouse) to click the dialogs caption to move it about the mouse gets
re-aquired and the whole dialog jumps in big steps to the bottom of the desktop, leaving only the caption bar visible.
I know *why* that that happens (the mouse gets centered to the dialog, the dialog caption jumps to the mouse position, rinse and repeat) and can likely write something that will first check if the mouse is in the client area of
the dialog and only than call the code updating the camera, I was wondering
if its already build in.
tl;dr:
How do I tell IDirectInputDevice8 to ignore the mouse when its not inside
the client-area of the dialog - so I can resize the dialog or move it.
-or-
Which WM_* event(s) should I use to acquire and unacquire the mouse so the above doesn't happen when I F10 and click outside the dialogs client area.
Regards,
Rudy Wieser
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)