Esempio n. 1
0
 /// <summary>Checks an arbitrary input event.</summary>
 /// <remarks>Checks an arbitrary input event.</remarks>
 /// <param name="event">The event.</param>
 /// <param name="nestingLevel">
 /// The nesting level: 0 if called from the base class,
 /// or 1 from a subclass.  If the event was already checked by this consistency verifier
 /// at a higher nesting level, it will not be checked again.  Used to handle the situation
 /// where a subclass dispatching method delegates to its superclass's dispatching method
 /// and both dispatching methods call into the consistency verifier.
 /// </param>
 public void onInputEvent(android.view.InputEvent @event, int nestingLevel)
 {
     if (@event is android.view.KeyEvent)
     {
         android.view.KeyEvent keyEvent = (android.view.KeyEvent)@event;
         onKeyEvent(keyEvent, nestingLevel);
     }
     else
     {
         android.view.MotionEvent motionEvent = (android.view.MotionEvent)@event;
         if (motionEvent.isTouchEvent())
         {
             onTouchEvent(motionEvent, nestingLevel);
         }
         else
         {
             if ((motionEvent.getSource() & android.view.InputDevice.SOURCE_CLASS_TRACKBALL) !=
                 0)
             {
                 onTrackballEvent(motionEvent, nestingLevel);
             }
             else
             {
                 onGenericMotionEvent(motionEvent, nestingLevel);
             }
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Notifies the verifier that a given event was unhandled and the rest of the
 /// trace for the event should be ignored.
 /// </summary>
 /// <remarks>
 /// Notifies the verifier that a given event was unhandled and the rest of the
 /// trace for the event should be ignored.
 /// This method should only be called if the event was previously checked by
 /// the consistency verifier using
 /// <see cref="onInputEvent(InputEvent, int)">onInputEvent(InputEvent, int)</see>
 /// and other methods.
 /// </remarks>
 /// <param name="event">The event.</param>
 /// <param name="nestingLevel">
 /// The nesting level: 0 if called from the base class,
 /// or 1 from a subclass.  If the event was already checked by this consistency verifier
 /// at a higher nesting level, it will not be checked again.  Used to handle the situation
 /// where a subclass dispatching method delegates to its superclass's dispatching method
 /// and both dispatching methods call into the consistency verifier.
 /// </param>
 public void onUnhandledEvent(android.view.InputEvent @event, int nestingLevel)
 {
     if (nestingLevel != mLastNestingLevel)
     {
         return;
     }
     if (mRecentEventsUnhandled != null)
     {
         mRecentEventsUnhandled[mMostRecentEventIndex] = true;
     }
     if (@event is android.view.KeyEvent)
     {
         android.view.KeyEvent keyEvent = (android.view.KeyEvent)@event;
         int deviceId = keyEvent.getDeviceId();
         int source   = keyEvent.getSource();
         int keyCode  = keyEvent.getKeyCode();
         android.view.InputEventConsistencyVerifier.KeyState state = findKeyState(deviceId
                                                                                  , source, keyCode, false);
         if (state != null)
         {
             state.unhandled = true;
         }
     }
     else
     {
         android.view.MotionEvent motionEvent = (android.view.MotionEvent)@event;
         if (motionEvent.isTouchEvent())
         {
             mTouchEventStreamUnhandled = true;
         }
         else
         {
             if ((motionEvent.getSource() & android.view.InputDevice.SOURCE_CLASS_TRACKBALL) !=
                 0)
             {
                 if (mTrackballDown)
                 {
                     mTrackballUnhandled = true;
                 }
             }
         }
     }
 }