Code: Select all
mDevice->getCursorControl()->setVisible(!mDevice->getCursorControl()->isVisible());
Code: Select all
mDevice->getCursorControl()->setPosition(mDevice->getCursorControl()->getPosition());
Code: Select all
switch (e.MouseInput.Event) {
case EMIE_LMOUSE_PRESSED_DOWN: {
mDevice->getCursorControl()->setVisible(false);
mDevice->getCursorControl()->setPosition(mDevice->getCursorControl()->getPosition());
break;
}
case EMIE_LMOUSE_LEFT_UP: {
mDevice->getCursorControl()->setVisible(true);
mDevice->getCursorControl()->setPosition(mDevice->getCursorControl()->getPosition());
break;
}
default:
break;
}
Something I've noticed while trying to debug this is that if I remove the code to set the cursor visible again when the LMB is released, when I press it, the cursor is still visible, but when I -release- it again, it gets hidden! Which is sorta the opposite of what I want. It's like these hide/unhide events are being somehow delayed until the mouse button is lifted again, and only when this is applied to the mouse buttons, not the keyboard keys...