MouseButton will not release...

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

RebornX
Just popping in
Just popping in
Posts: 1
Joined: Sun May 09, 2010 18:45

MouseButton will not release...

Postby RebornX » Sun May 09, 2010 18:56

hi,

I have a problem. I get the MouseInput in this way :

Code: Select all

      SHORT keystate;
      keystate = GetAsyncKeyState(VK_LBUTTON);
      if(keystate & 0x0001 )
      {   CEGUI::System::getSingleton().injectMouseButtonUp( CEGUI::MouseButton::LeftButton );

      }
      if(keystate >> 8)
      {
         CEGUI::System::getSingleton().injectMouseButtonDown( CEGUI::MouseButton::LeftButton );
      }

But when i drag a cegui window it seems to ignore me releasing the button and will stick to the Cursor...

when i set breakpoints to these functions, they fired correctly. injectMouseButtonUp fired when the button was released and injectMouseButtonDown fired when the button is pushed.

I initialize cegui like this (with d3d11 beta rederer from this board):

Code: Select all

   m_pDev11 = new ID3D11Device_Full;

   m_pDev11->dev11=pDevice;
   m_pDev11->devc11=pImmediateContext;

   CEGUI::Direct3D10Renderer& myRenderer = CEGUI::Direct3D10Renderer::create( m_pDev11 );
   CEGUI::System::create( myRenderer );

   // initialise the required dirs for the DefaultResourceProvider
   CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
      (CEGUI::System::getSingleton().getResourceProvider());

   rp->setResourceGroupDirectory("schemes", "datafiles/schemes/");
   rp->setResourceGroupDirectory("imagesets", "datafiles/imagesets/");
   rp->setResourceGroupDirectory("fonts", "datafiles/fonts/");
   rp->setResourceGroupDirectory("layouts", "datafiles/layouts/");
   rp->setResourceGroupDirectory("looknfeels", "datafiles/looknfeel/");
   rp->setResourceGroupDirectory("lua_scripts", "datafiles/lua_scripts/");


   // set the default resource groups to be used
   CEGUI::Imageset::setDefaultResourceGroup("imagesets");
   CEGUI::Font::setDefaultResourceGroup("fonts");
   CEGUI::Scheme::setDefaultResourceGroup("schemes");
   CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
   CEGUI::WindowManager::setDefaultResourceGroup("layouts");
   CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");


   // create (load) the TaharezLook scheme file
   // (this auto-loads the TaharezLook looknfeel and imageset files)
   CEGUI::SchemeManager::getSingleton().create( "TaharezLook.scheme" );

   // create (load) a font.
   // The first font loaded automatically becomes the default font, but note
   // that the scheme might have already loaded a font, so there may already
   // be a default set - if we want the "Commonweath-10" font to definitely
   // be the default, we should set the default explicitly afterwards.
   CEGUI::FontManager::getSingleton().create( "DejaVuSans-10.font" );

   CEGUI::System::getSingleton().setDefaultFont( "DejaVuSans-10" );
   CEGUI::System::getSingleton().setDefaultMouseCursor( "TaharezLook", "MouseArrow" );
   CEGUI::System::getSingleton().setDefaultTooltip( "TaharezLook/Tooltip" );

   CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
   CEGUI::Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
   CEGUI::System::getSingleton().setGUISheet( myRoot );

   CEGUI::FrameWindow* fWnd = static_cast<CEGUI::FrameWindow*>(
      wmgr.createWindow( "TaharezLook/FrameWindow", "testWindow" ));

   myRoot->addChildWindow( fWnd );

   // position a quarter of the way in from the top-left of parent.
   fWnd->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.25f, 0 ) ) );

   // set size to be half the size of the parent
   fWnd->setSize( CEGUI::UVector2( CEGUI::UDim( 0.5f, 0 ), CEGUI::UDim( 0.5f, 0 ) ) );

   fWnd->setText( "Hello World!" );

Return to “Help”

Who is online

Users browsing this forum: No registered users and 4 guests