Android Guides | Samples

Android.App.Dialog.OnKeyDown Method

A key was pressed down.

Syntax

[Android.Runtime.Register("onKeyDown", "(ILandroid/view/KeyEvent;)Z", "GetOnKeyDown_ILandroid_view_KeyEvent_Handler")]
public virtual Boolean OnKeyDown (Keycode keyCode, KeyEvent e)

See Also

Parameters

keyCode
The value in event.getKeyCode().
e
Description of the key event.

Remarks

A key was pressed down.

If the focused view didn't want this event, this method is called.

The default implementation consumed the KEYCODE_BACK to later handle it in Dialog.OnKeyUp(Keycode,KeyEvent).

[Android Documentation]

Requirements

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