Lines Matching refs:event

40  * If enabled, it will observe motion events from mouse source, and send click event sequence
66 // Lazily created on the first mouse motion event.
76 public void onMotionEvent(MotionEvent event, MotionEvent rawEvent, int policyFlags) {
77 if (event.isFromSource(InputDevice.SOURCE_MOUSE)) {
86 handleMouseMotion(event, policyFlags);
92 mNext.onMotionEvent(event, rawEvent, policyFlags);
97 public void onKeyEvent(KeyEvent event, int policyFlags) {
99 if (KeyEvent.isModifierKey(event.getKeyCode())) {
100 mClickScheduler.updateMetaState(event.getMetaState());
107 mNext.onKeyEvent(event, policyFlags);
112 public void onAccessibilityEvent(AccessibilityEvent event) {
114 mNext.onAccessibilityEvent(event);
146 private void handleMouseMotion(MotionEvent event, int policyFlags) {
147 switch (event.getActionMasked()) {
149 if (event.getPointerCount() == 1) {
150 mClickScheduler.update(event, policyFlags);
240 * Schedules and performs click event sequence that should be initiated when mouse pointer stops
247 * discarded as noise. Anchor is the position of the last MOVE event that was not considered
257 /** Last observed motion event. null if no events have been observed yet. */
259 /** Last observed motion event's policy flags. */
261 /** Current meta state. This value will be used as meta state for click event sequence. */
267 * motion event may have been labeled as noise).
303 * Updates properties that should be used for click event sequence initiated by this object,
305 * Should be called whenever new motion event is observed.
307 * @param event Motion event whose properties should be used as a base for click event
309 * @param policyFlags Policy flags that should be send with click event sequence.
311 public void update(MotionEvent event, int policyFlags) {
312 mMetaState = event.getMetaState();
314 boolean moved = detectMovement(event);
315 cacheLastEvent(event, policyFlags, mLastMotionEvent == null || moved /* useAsAnchor */);
373 * Updates last observed motion event.
375 * @param event The last observed event.
376 * @param policyFlags The policy flags used with the last observed event.
377 * @param useAsAnchor Whether the event coords should be used as a new anchor.
379 private void cacheLastEvent(MotionEvent event, int policyFlags, boolean useAsAnchor) {
383 mLastMotionEvent = MotionEvent.obtain(event);
402 * @param event Observed motion event.
403 * @return Whether the event coords are far enough from the anchor for the event not to be
406 private boolean detectMovement(MotionEvent event) {
410 final int pointerIndex = event.getActionIndex();
411 float deltaX = mAnchorCoords.x - event.getX(pointerIndex);
412 float deltaY = mAnchorCoords.y - event.getY(pointerIndex);
418 * Creates and forwards click event sequence.