public final class Events extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Events.InputEvent
A facade over MotionEvent primarily designed to permit for unit testing
of related code.
|
static class |
Events.MotionInputEvent |
Constructor and Description |
---|
Events() |
Modifier and Type | Method and Description |
---|---|
static boolean |
hasShiftBit(int metaState)
Returns true if the "SHIFT" bit is set.
|
static boolean |
isActionDown(MotionEvent e)
Returns true if event was triggered by a finger or stylus touch.
|
static boolean |
isActionUp(MotionEvent e)
Returns true if event was triggered by a finger or stylus touch.
|
static boolean |
isMouseEvent(MotionEvent e)
Returns true if event was triggered by a mouse.
|
static boolean |
isMouseType(int toolType)
Returns true if event was triggered by a mouse.
|
static boolean |
isNavigationKeyCode(int keyCode)
Whether or not the given keyCode represents a navigation keystroke (e.g. up, down, home).
|
boolean |
isShiftPressed(MotionEvent e)
Returns true if the shift is pressed.
|
static boolean |
isTouchEvent(MotionEvent e)
Returns true if event was triggered by a finger or stylus touch.
|
static boolean |
isTouchType(int toolType)
Returns true if event was triggered by a finger or stylus touch.
|
public static boolean isMouseEvent(MotionEvent e)
public static boolean isTouchEvent(MotionEvent e)
public static boolean isMouseType(int toolType)
public static boolean isTouchType(int toolType)
public static boolean isActionDown(MotionEvent e)
public static boolean isActionUp(MotionEvent e)
public boolean isShiftPressed(MotionEvent e)
public static boolean isNavigationKeyCode(int keyCode)
keyCode
- public static boolean hasShiftBit(int metaState)