Summary
Public Methods |
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(Object target)
Stop any tracking associated with this target.
|
void
|
reset()
Reset back to initial state.
|
void
|
startTracking(KeyEvent event, Object target)
Start tracking the key code associated with the given event.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
public
KeyEvent.DispatcherState
()
Public Methods
public
void
handleUpEvent
(KeyEvent event)
Handle key up event to stop tracking. This resets the dispatcher state,
and updates the key event state based on it.
This is only needed if you are directly dispatching events, rather
than handling them in onKeyUp(int, KeyEvent)
.
public
boolean
isTracking
(KeyEvent event)
Return true if the key event is for a key code that is currently
being tracked by the dispatcher.
public
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.
This is only needed if you are directly dispatching events, rather
than handling them in onKeyLongPress(int, KeyEvent)
.
public
void
reset
(Object target)
Stop any tracking associated with this target.
public
void
reset
()
Reset back to initial state.
public
void
startTracking
(KeyEvent event, Object target)
Start tracking the key code associated with the given event. This
can only be called on a key down. It will allow you to see any
long press associated with the key, and will result in
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 onKeyDown(int, KeyEvent)
.