OnKeyListener

fun interface OnKeyListener

Interface definition for a callback to be invoked when a hardware key event is dispatched to this dialog. The callback will be invoked before the key event is given to the view. This is only useful for hardware keyboards; a software input method has no obligation to trigger this listener.

Functions

Link copied to clipboard
abstract fun onKey(keyCode: Int, event: KeyEvent): Boolean

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