Ripiz
26-12-2011 20:19:28
Hello,
I am using Visual Studio 2010 and MyGUI revision 4341 with DirectX 11 renderer.
Following code is used to send mouse events to MyGUI:
However I noticed some issues, if I press on item in ComboBox and continue holding mouse button without moving mouse function MyGUI::InputManager::getInstance().getMouseFocusWidget() returns 0, therefore application processes mouse like it's not over GUI. I tried to make workaround, by sending MouseMove event after mouse input:
And it did work, however new issues appeared; if there's a button under where I clicked, releasing mouse presses the button behind it, for example ( http://img847.imageshack.us/img847/8199/92293149.png ), if you press on Dirt.dds or Grass1.dds it'll also click the button behind it.
So my question is, is this a bug, or I've handled input incorrectly?
Thank you in advance.
I am using Visual Studio 2010 and MyGUI revision 4341 with DirectX 11 renderer.
Following code is used to send mouse events to MyGUI:
if(uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST) {
if(uMsg == WM_MOUSEMOVE)
Handled += MyGUI::InputManager::getInstance().injectMouseMove(LOWORD(lParam), HIWORD(lParam), 0);
else {
if(uMsg == WM_LBUTTONDOWN)
Handled += MyGUI::InputManager::getInstance().injectMousePress(LOWORD(lParam), HIWORD(lParam), MyGUI::MouseButton::Button0);
else if(uMsg == WM_LBUTTONUP)
Handled += MyGUI::InputManager::getInstance().injectMouseRelease(LOWORD(lParam), HIWORD(lParam), MyGUI::MouseButton::Button0);
else if(uMsg == WM_RBUTTONDOWN)
Handled += MyGUI::InputManager::getInstance().injectMousePress(LOWORD(lParam), HIWORD(lParam), MyGUI::MouseButton::Button1);
else if(uMsg == WM_RBUTTONUP)
Handled += MyGUI::InputManager::getInstance().injectMouseRelease(LOWORD(lParam), HIWORD(lParam), MyGUI::MouseButton::Button1);
else if(uMsg == WM_MBUTTONDOWN)
Handled += MyGUI::InputManager::getInstance().injectMousePress(LOWORD(lParam), HIWORD(lParam), MyGUI::MouseButton::Button2);
else if(uMsg == WM_MBUTTONUP)
Handled += MyGUI::InputManager::getInstance().injectMouseRelease(LOWORD(lParam), HIWORD(lParam), MyGUI::MouseButton::Button2);
}
}
if(!Handled) {
// application input
}
However I noticed some issues, if I press on item in ComboBox and continue holding mouse button without moving mouse function MyGUI::InputManager::getInstance().getMouseFocusWidget() returns 0, therefore application processes mouse like it's not over GUI. I tried to make workaround, by sending MouseMove event after mouse input:
else if(uMsg == WM_MBUTTONUP)
// ...
if(Handled)
Handled += MyGUI::InputManager::getInstance().injectMouseMove(LOWORD(lParam), HIWORD(lParam), 0);
And it did work, however new issues appeared; if there's a button under where I clicked, releasing mouse presses the button behind it, for example ( http://img847.imageshack.us/img847/8199/92293149.png ), if you press on Dirt.dds or Grass1.dds it'll also click the button behind it.
So my question is, is this a bug, or I've handled input incorrectly?
Thank you in advance.