Exemplo n.º 1
0
void
WaterScreen::handleEvent (XEvent *event)
{
    switch (event->type) {
	case ButtonPress:
	    if (event->xbutton.root == screen->root () && grabIndex)
	    {
		XPoint p;

		p.x = pointerX;
		p.y = pointerY;

		waterVertices (GL_POINTS, &p, 1, 0.8f);
		cScreen->damageScreen ();
	    }
	    break;
	case EnterNotify:
	case LeaveNotify:
	    if (event->xcrossing.root == screen->root () && grabIndex)
		handleMotionEvent ();
	    break;
	case MotionNotify:
	    if (event->xmotion.root == screen->root () && grabIndex)
		handleMotionEvent ();
	default:
	    break;
    }

    screen->handleEvent (event);
}
Exemplo n.º 2
0
	void onAndroidInput(const AndroidInputEvent* evt)
	{
		AInputEvent* input = evt->getInput();

		if (AInputEvent_getType(input) == AINPUT_EVENT_TYPE_MOTION)
		{
			handleMotionEvent(input);
		}
	}
Exemplo n.º 3
0
static void handleInput(MirEvent const* event, _GLFWwindow* window)
{
    switch (event->type)
    {
        case mir_event_type_key:
            handleKeyEvent(event->key, window);
            break;
        case mir_event_type_motion:
            handleMotionEvent(event->motion, window);
            break;
        default:
            break;
    }
}