April 2015
Beginner to intermediate
494 pages
10h 26m
English
Let's intercept touch events in DroidBlaster:
ActivityHandler to process application events in Chapter 5, Writing a Fully Native Application, create jni/InputHandler.hpp to process input events. The input API is declared in android/input.h. Create onTouchEvent() to handle touch events. These events are packaged in an AInputEvent structure. Other input peripherals will be described later in this chapter:#ifndef _PACKT_INPUTHANDLER_HPP_
#define _PACKT_INPUTHANDLER_HPP_
#include <android/input.h>
class InputHandler {
public:
virtual ~InputHandler() {};
virtual bool onTouchEvent(AInputEvent* pEvent) = 0;
};
#endifjni/EventLoop.hpp header file to include and handle an ...