View.DispatchKeyEvent(KeyEvent) Method

Definition

Dispatch a key event to the next view on the focus path.

[Android.Runtime.Register("dispatchKeyEvent", "(Landroid/view/KeyEvent;)Z", "GetDispatchKeyEvent_Landroid_view_KeyEvent_Handler")]
public virtual bool DispatchKeyEvent (Android.Views.KeyEvent? e);
[<Android.Runtime.Register("dispatchKeyEvent", "(Landroid/view/KeyEvent;)Z", "GetDispatchKeyEvent_Landroid_view_KeyEvent_Handler")>]
abstract member DispatchKeyEvent : Android.Views.KeyEvent -> bool
override this.DispatchKeyEvent : Android.Views.KeyEvent -> bool

Parameters

e
KeyEvent

The key event to be dispatched.

Returns

True if the event was handled, false otherwise.

Attributes

Remarks

Dispatch a key event to the next view on the focus path. This path runs from the top of the view tree down to the currently focused view. If this view has focus, it will dispatch to itself. Otherwise it will dispatch the next node down the focus path. This method also fires any key listeners.

Java documentation for android.view.View.dispatchKeyEvent(android.view.KeyEvent).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to