Mac OS X - Mouse Events

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

Dalon
Just popping in
Just popping in
Posts: 11
Joined: Wed Sep 15, 2010 13:55

Mac OS X - Mouse Events

Postby Dalon » Wed May 18, 2011 15:12

Hi there,

I hope I am not totally wrong here with my issue :) I am writing a little test game and want it to run on Windows and Mac OS X as well (maybe linux too, later ^^). I'm using Ogre3D (1.7.2), CEGUI (0.7.5) and OIS (don't know the exact version) and it works great on Windows.

I also got it running on Mac OS X after having some startup problems, missing the PlugInBundle Folder content etc. ^^ Now it starts, and my Software Mouse Cursor moves correctly (it is displayed at the correct position, so i guess CEGUI gets the correct information from OIS) BUT my button controls don't do anything... I can't click them... They don't highlight on mouseover and so on. On windows, anything seems to be okay.

Screenshot in windows with button down
(The cursor is hidden here because I use the hardware cursor in windows and hide the CEGUI Software cursor)

Screenshot in Mac OS X - Button does not react in any way

And maybe some code...?

Code: Select all

bool Game::mouseMoved(const OIS::MouseEvent &arg)
{
    // Inject mouse movement
   m_pGUISystem->injectMousePosition((float)arg.state.X.abs, (float)arg.state.Y.abs);
    //m_pGUISystem->injectMouseMove((float)arg.state.X.rel, (float)arg.state.Y.rel);
    // Same result with both calls above on Mac OS X... correct CEGUI::MouseCursor position but no reaction from the buttons

   // Update active game state
   if (m_pActiveState)
      m_pActiveState->mouseMoved(arg);

   return true;
}

(this method is called correctly, I logged to check)

Code: Select all

bool Game::mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id)
{
   m_pGUISystem->injectMouseButtonDown((CEGUI::MouseButton)id);

   // Update active game state
   if (m_pActiveState)
      m_pActiveState->mousePressed(arg, id);

   return true;
}


Code: Select all

bool Game::mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id)
{
   m_pGUISystem->injectMouseButtonUp((CEGUI::MouseButton)id);

   // Update active game state
   if (m_pActiveState)
      m_pActiveState->mouseReleased(arg, id);

   return true;
}


Any suggestions? :(
Last edited by Dalon on Wed May 18, 2011 17:42, edited 2 times in total.

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

Re: Mac OS X - Mouse Events

Postby Kulik » Wed May 18, 2011 15:50

Code: Select all

17:48 < Kulik> can you just cast OIS::MouseButton ato CEGUI::MouseButton?
17:48 < Kulik> http://cegui.org.uk/phpBB2/viewtopic.php?f=10&t=5599
17:48 < Kulik> I think you should be able to but I wouldn't do that
17:48 < CrazyEddie> no
17:48 -!- Ident [506d298a@gateway/web/freenode/ip.80.109.41.138] has quit [Ping
          timeout: 252 seconds]
17:49 < Kulik> according to C++ spec the enums of CEGUI will get unique values
               within the enum but no word about what their integer values will
               be
17:49 < CrazyEddie> it should be done like it's done in the samples

EDIT: Kulik shows the entire internetz that he didn't read the C++ specification

That's the first thing I would fix. That said I am quite sceptic that this is _the problem_.

Dalon
Just popping in
Just popping in
Posts: 11
Joined: Wed Sep 15, 2010 13:55

Re: Mac OS X - Mouse Events

Postby Dalon » Wed May 18, 2011 15:55

Okay, I fixed that but as you guessed, that's not the problem. Also, it worked like this before (on windows, can't tell for mac os x) but even the mouseOver-state of the button seems not to be activated, allthought the CEGUI Mouse Cursor moves correctly.

Dalon
Just popping in
Just popping in
Posts: 11
Joined: Wed Sep 15, 2010 13:55

Re: Mac OS X - Mouse Events

Postby Dalon » Wed May 18, 2011 16:13

I managed to find out a few more details...

The button click events are working! So when I click on a button, the event is fired correctly. I think CEGUI just does not render correctly for some reason I don't know...

Edit: I now downloaded the latest prebuild SDK of CEGUI and recompiled my project on the mac and it now works as it should Oo Only my Editbox acts a little bit strange with the carat... but okay, thats not too bad i think.

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

Re: Mac OS X - Mouse Events

Postby Kulik » Wed May 18, 2011 16:23

Hmm that moves the problem from the weird category to the "very weird" category. :lol:

Anyways, good that you got that fixed.

Dalon
Just popping in
Just popping in
Posts: 11
Joined: Wed Sep 15, 2010 13:55

Re: Mac OS X - Mouse Events

Postby Dalon » Wed May 18, 2011 16:35

Yeah i mean... it compiled... it linked... it started... and it didn't crash... it just did not work like I expected it to work.

I guess in Windows I would have gotten some error message on app start like "Method XXXXXX wasn't defined in module CEGUIOgreRenderer.dll" or something like that.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 15 guests