[SOLVED]Mouse handling in Windows OS

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Rampage
Just popping in
Just popping in
Posts: 7
Joined: Sun Jul 03, 2011 14:18

[SOLVED]Mouse handling in Windows OS

Postby Rampage » 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?

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
Last edited by Rampage on Wed Jul 06, 2011 08:49, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Mouse handling in Windows OS

Postby Kulik » Mon Jul 04, 2011 16:11

I am not familiar with WinAPI and would have to look up the details to be sure.

However CEGUI allows 2 mouse injects. One is relative (which is what you are using - injectMouseMove) and the other is absolute (injectMousePosition). I suggest you give the absolute inject a try.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 3 guests