[SOLVED]Mouse handling in Windows OS
Posted: Sun Jul 03, 2011 14:28
Hallo, i have a problem with handling mouse inputs in CEGUI. Simply, i cant find any working code.
I tried something, but it doesnt works, heres my code. It seems, i need to covert absolute cursor position to relative. Can you plese help me how to correctly handle mouse input?
EDIT: I found CEGUI api function, that uses exact coordinates. So you just need to use it and everyhing is working correctly
I tried something, but it doesnt works, heres my code. It seems, i need to covert absolute cursor position to relative. Can you plese help me how to correctly handle mouse input?
Code: Select all
switch(message)
{
case WM_MOUSEMOVE:
{
bool test = CEGUI::System::getSingleton().injectMouseMove((float)LOWORD(lParam),(float)HIWORD(lParam));
if(!test)
CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseArrow");
}
break;
case WM_LBUTTONDOWN:
{
CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::LeftButton);
}
break;
case WM_LBUTTONUP:
{
CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::LeftButton);
}
}
EDIT: I found CEGUI api function, that uses exact coordinates. So you just need to use it and everyhing is working correctly