Handling Controller Actions | Android Developers
The following code snippet shows a helper class that lets you check the hat axis and key code values from an input event to determine the D-pad direction. public class Dpad { final static int UP = 0; final static int LEFT = 1; final static int RIGHT = 2 ....