Beispiel #1
0
bool gkWindowAndroid::touchMoved(const OIS::MultiTouchEvent& arg)
{
	gkMouse& data = m_mouse;
	OIS::MultiTouchState state = arg.state;;

	transformInputState(state);

	data.position.x = (gkScalar)state.X.abs;
	data.position.y = (gkScalar)state.Y.abs;
	data.relative.x = (gkScalar)state.X.rel;
	data.relative.y = (gkScalar)state.Y.rel;
	data.moved = true;

	data.wheelDelta = 0;

	if (!m_listeners.empty())
	{
		gkWindowSystem::Listener* node = m_listeners.begin();
		while (node)
		{
			node->mouseMoved(data);
			node = node->getNext();
		}
	}

	return true;
}
Beispiel #2
0
  virtual bool touchCancelled(const OIS::MultiTouchEvent& evt) {
    OIS::MultiTouchState state = evt.state;
    transformInputState(state);
    OIS::MultiTouchEvent orientedEvt((OIS::Object*)evt.device, state);
    for (auto pListener : m_ListenerList) {
      if (pListener->isInputListenerEnabled()) {
	if (!pListener->touchCancelled(orientedEvt)) {
	  break;
	}
      }
    }
    return true;
  }
Beispiel #3
0
  virtual bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id ) {
    OIS::MouseState state = arg.state;
    transformInputState(state);
    OIS::MouseEvent orientedEvt((OIS::Object*)arg.device, state);
    for (auto pListener : m_ListenerList) {
      if (pListener->isInputListenerEnabled()) {
	if (!pListener->mouseReleased(orientedEvt, id)) {
	  break;
	}
      }
    }
    return true;
  }