View.IOnKeyListener.OnKey(View, Keycode, KeyEvent) Method

Definition

Called when a hardware key is dispatched to a view.

[Android.Runtime.Register("onKey", "(Landroid/view/View;ILandroid/view/KeyEvent;)Z", "GetOnKey_Landroid_view_View_ILandroid_view_KeyEvent_Handler:Android.Views.View/IOnKeyListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OnKey (Android.Views.View? v, Android.Views.Keycode keyCode, Android.Views.KeyEvent? e);
[<Android.Runtime.Register("onKey", "(Landroid/view/View;ILandroid/view/KeyEvent;)Z", "GetOnKey_Landroid_view_View_ILandroid_view_KeyEvent_Handler:Android.Views.View/IOnKeyListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnKey : Android.Views.View * Android.Views.Keycode * Android.Views.KeyEvent -> bool

Parameters

v
View

The view the key has been dispatched to.

keyCode
Keycode

The code for the physical key that was pressed

e
KeyEvent

The KeyEvent object containing full information about the event.

Returns

Boolean
Attributes

Remarks

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