Android.Views.View.IOnKeyListener.OnKey Method
Called when a hardware key is dispatched to a view.

Syntax

[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 (View v, [Android.Runtime.GeneratedEnum] Keycode keyCode, KeyEvent e)

Parameters

v
The view the key has been dispatched to.
keyCode
The code for the physical key that was pressed
e
The KeyEvent object containing full information about the event.

Returns

Documentation for this section has not yet been entered.

Remarks

Called when a hardware key is dispatched to a view. This allows listeners to get a chance to respond before the target view.

Key presses in software keyboards will generally NOT trigger this method, although some may elect to do so in some situations. Do not assume a software input method has to be key-based; even if it is, it may use key presses in a different way than you expect, so there is no way to reliably catch soft input key presses.

[Android Documentation]

Requirements

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