bool CursorWorldListener::windowMouseDoubleClick(const CEGUI::EventArgs& args)
{
	const CEGUI::MouseEventArgs& mouseArgs = static_cast<const CEGUI::MouseEventArgs&>(args);
	sendWorldClick(MPT_DOUBLECLICK, mouseArgs.position);

	return true;
}
Beispiel #2
0
bool CursorWorldListener::windowMouseButtonUp(const CEGUI::EventArgs& args)
{
	if (isInGUIMode()) {
		if (mMousePressedStart != 0) {
			if ((Time::currentTimeMillis() - mMousePressedStart) < mClickThresholdMilliseconds) {
				mMousePressedStart = 0;
				sendWorldClick(MPT_CLICK, static_cast<const CEGUI::MouseEventArgs&>(args).position);
			}
		}
	}
	return true;
}
bool CursorWorldListener::windowMouseButtonUp(const CEGUI::EventArgs& args)
{
	if (isInGUIMode()) {
		if (mMousePressedTimeFrame) {
			if (mMousePressedTimeFrame->isTimeLeft()) {
				delete mMousePressedTimeFrame;
				mMousePressedTimeFrame = 0;
				sendWorldClick(MPT_CLICK, static_cast<const CEGUI::MouseEventArgs&>(args).position);
			}
		}
	}
	return true;
}
Beispiel #4
0
bool CursorWorldListener::windowMouseButtonDown(const CEGUI::EventArgs& args)
{
	if (isInGUIMode()) {
		S_LOG_VERBOSE("Main sheet is capturing input");
		CEGUI::Window* aWindow = CEGUI::Window::getCaptureWindow();
		if (aWindow) {
			aWindow->releaseInput();
			aWindow->deactivate();
		}

		mMousePressedStart = Time::currentTimeMillis();
		sendWorldClick(MPT_PRESS, CEGUI::MouseCursor::getSingleton().getPosition());
	}

	return true;
}
bool CursorWorldListener::windowMouseButtonDown(const CEGUI::EventArgs& args)
{
	if (isInGUIMode()) {
		S_LOG_VERBOSE("Main sheet is capturing input");
		CEGUI::Window* aWindow = CEGUI::Window::getCaptureWindow();
		if (aWindow) {
			aWindow->releaseInput();
			aWindow->deactivate();
		}

		delete mMousePressedTimeFrame;
		mMousePressedTimeFrame = new TimeFrame(boost::posix_time::milliseconds(mClickThresholdMilliseconds));
		sendWorldClick(MPT_PRESS, CEGUI::MouseCursor::getSingleton().getPosition());
	}

	return true;
}
Beispiel #6
0
void CursorWorldListener::afterEventProcessing(float timeslice)
{
	if (!mHoverEventSent) {
		mCursorLingerStart += timeslice * 1000;

		if (mCursorLingerStart > 500) {
			sendHoverEvent();
		}
	}

	if (isInGUIMode()) {
		if (mMousePressedStart != 0) {
			if ((Time::currentTimeMillis() - mMousePressedStart) > mClickThresholdMilliseconds) {
				mMousePressedStart = 0;
				sendWorldClick(MPT_PRESSED, CEGUI::MouseCursor::getSingleton().getPosition());
			}
		}
	}
}
void CursorWorldListener::afterEventProcessing(float timeslice)
{
	if (!mHoverEventSent) {
		mCursorLingerStart += timeslice * 1000;

		if (mCursorLingerStart > 500) {
			sendHoverEvent();
		}
	}

	if (isInGUIMode()) {
		if (mMousePressedTimeFrame) {
			if (!mMousePressedTimeFrame->isTimeLeft()) {
				delete mMousePressedTimeFrame;
				mMousePressedTimeFrame = 0;
				sendWorldClick(MPT_PRESSED, CEGUI::MouseCursor::getSingleton().getPosition());
			}
		}
	}
}
void CursorWorldListener::sendHoverEvent()
{
	const CEGUI::Vector2& pixelPosition = CEGUI::MouseCursor::getSingleton().getPosition();
	sendWorldClick(MPT_HOVER, pixelPosition);
	mHoverEventSent = true;
}
Beispiel #9
0
void CursorWorldListener::sendHoverEvent()
{
	const auto& pixelPosition = mMainWindow.getGUIContext().getMouseCursor().getPosition();
	sendWorldClick(MPT_HOVER, pixelPosition);
	mHoverEventSent = true;
}