public static interface WindowSurface.RawEventFilter
When the method RawEvent getRawEvent(TimeOut howLongToWait) is called on the WindowSurface the method getPendingEvent() is called on the filters, starting with the topmost, down to the lowest one. If at any point the getPendingEvent() method returns true, then the acceptReceivedEvent() method is called on the filters above the one that returned an event starting with the one immediately above it and working its way back up. Each higher filter therefore has an opportunity to modify the RawEvent (by modifying the received parameter directly) or it can reject the RawEvent completely by returning false.
If, during the getPendingEvent() sweep each filter returns false (indicating no pending events) then finally getRawEvent() is called on the native WindowSurface itself. The value returned from that is then passed to acceptReceivedEvent() on all the filters starting from the bottom.
Modifier and Type | Method and Description |
---|---|
boolean |
acceptReceivedEvent(RawEvent received)
This is called when a RawEvent is received from a filter lower in the chain (or from the
native WindowSurface itself).
|
boolean |
getPendingEvent(long timeToWait,
RawEvent destination)
This is called when a raw event is requested.
|
boolean getPendingEvent(long timeToWait, RawEvent destination) throws InterruptedException
timeToWait
- the time to wait. If this is negative then this indicates
an indefinite wait.destination
- a non-null destination RawEvent provided by the WindowSurface.InterruptedException
boolean acceptReceivedEvent(RawEvent received)
received
- the RawEvent received from the lower filter. This can be modified by this filter
if necessary.