Android.Views.View.OnGenericMotionEvent Method
Implement this method to handle generic motion events.

Syntax

[Android.Runtime.Register("onGenericMotionEvent", "(Landroid/view/MotionEvent;)Z", "GetOnGenericMotionEvent_Landroid_view_MotionEvent_Handler")]
public virtual bool OnGenericMotionEvent (MotionEvent e)

Parameters

e
The generic motion event being processed.

Returns

Documentation for this section has not yet been entered.

Remarks

Implement this method to handle generic motion events.

java Example

 public boolean onGenericMotionEvent(MotionEvent event) {
     if (event.isFromSource(InputDevice.SOURCE_CLASS_JOYSTICK)) {
         if (event.getAction() == MotionEvent.ACTION_MOVE) {
             // process the joystick movement...
             return true;
         }
     }
     if (event.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) {
         switch (event.getAction()) {
             case MotionEvent.ACTION_HOVER_MOVE:
                 // process the mouse hover movement...
                 return true;
             case MotionEvent.ACTION_SCROLL:
                 // process the scroll wheel movement...
                 return true;
         }
     }
     return super.onGenericMotionEvent(event);
 }

Generic motion events describe joystick movements, mouse hovers, track pad touches, scroll wheel movements and other input events. The MotionEvent.Source of the motion event specifies the class of input that was received. Implementations of this method must examine the bits in the source before processing the event. The following code example shows how this is done.

Generic motion events with source class InputDevice.SourceClassPointer are delivered to the view under the pointer. All other generic motion events are delivered to the focused view.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 12