public static class KeyEvent.DispatcherState extends Object
KeyEvent.dispatch(Callback, DispatcherState, Object)
for more advanced key dispatching, such as long presses.Constructor and Description |
---|
DispatcherState() |
Modifier and Type | Method and Description |
---|---|
void |
handleUpEvent(KeyEvent event)
Handle key up event to stop tracking.
|
boolean |
isTracking(KeyEvent event)
Return true if the key event is for a key code that is currently
being tracked by the dispatcher.
|
void |
performedLongPress(KeyEvent event)
Keep track of the given event's key code as having performed an
action with a long press, so no action should occur on the up.
|
void |
reset()
Reset back to initial state.
|
void |
reset(Object target)
Stop any tracking associated with this target.
|
void |
startTracking(KeyEvent event,
Object target)
Start tracking the key code associated with the given event.
|
public void reset()
public void reset(Object target)
public void startTracking(KeyEvent event, Object target)
KeyEvent.isTracking()
return true on the long press and up
events.
This is only needed if you are directly dispatching events, rather
than handling them in KeyEvent.Callback.onKeyDown(int, android.view.KeyEvent)
.
public boolean isTracking(KeyEvent event)
public void performedLongPress(KeyEvent event)
This is only needed if you are directly dispatching events, rather
than handling them in KeyEvent.Callback.onKeyLongPress(int, android.view.KeyEvent)
.
public void handleUpEvent(KeyEvent event)
This is only needed if you are directly dispatching events, rather
than handling them in KeyEvent.Callback.onKeyUp(int, android.view.KeyEvent)
.