Im sorry for bringing back a dead topic but im having the same problem and thought i would be overkill to start a new topic about the same subject
I want to hide my mouse cursor when the user has held down the left mouse button for 250ms and want to show it again when he releases it. However, it wont hide for some reason. Does anybody know if the code CuteAlien posted works? Im a bit scared of changing Irrlicht sourcecode so i'd like to know if somebody tested it with positive results.
getCursorControl()->setVisible dose not work.
-
- Posts: 21
- Joined: Wed May 20, 2009 8:17 pm
- Location: Qc, Canada
i also have the same problem. what i want to do is, if left click is pressed, hide the cursor and when left click is released show the cursor again. but it looks like the cursor dont get updated if i dont release the click
i am using
i am using
Code: Select all
ICursorControl* cursor = device->getCursorControl();
cursor->setVisible(false);
Don't worry - it's not dead, it's just sleeping :-) I wanted to look further into this anyway, I just couldn't reproduce the problem anymore last time I tried. But maybe with your new info I can.instinct wrote:Im sorry for bringing back a dead topic but im having the same problem and thought i would be overkill to start a new topic about the same subject :)
You haven't by chance already written a small example which I can just compile and test to reproduce this?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 21
- Joined: Wed May 20, 2009 8:17 pm
- Location: Qc, Canada
i am not sure how i can send you a working project via the forum but its very simple to test it, just adding this in the "05.UserInterface" demo project
the cursor does not become invisible, like if it does not get updated until you do a mouse up.
But, if i alt tab, keeping left click down and alt tab again now the cursor as diseapered and will reappear when i left click up
and sorry for my english, it is not my primary language
Code: Select all
virtual bool OnEvent(const SEvent& event)
//...
else if (event.EventType == irr::EET_MOUSE_INPUT_EVENT)
{
switch(event.MouseInput.Event)
{
case EMIE_LMOUSE_PRESSED_DOWN:
device->getCursorControl()->setVisible(false);
break;
case EMIE_LMOUSE_LEFT_UP:
device->getCursorControl()->setVisible(true);
break;
case EMIE_MOUSE_MOVED:
break;
default:
// We won't use the wheel
break;
}
}
But, if i alt tab, keeping left click down and alt tab again now the cursor as diseapered and will reappear when i left click up
and sorry for my english, it is not my primary language
Thx Alucard344, I could reproduce it with that.
I have added the fix to the svn trunk (my very first official bugfix - I hope I didn't mess up anything).
I have added the fix to the svn trunk (my very first official bugfix - I hope I didn't mess up anything).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria