Added in API level 1

MultiTapKeyListener


open class MultiTapKeyListener : BaseKeyListener, SpanWatcher
kotlin.Any
   ↳ android.text.method.MetaKeyKeyListener
   ↳ android.text.method.BaseKeyListener
   ↳ android.text.method.MultiTapKeyListener

This is the standard key listener for alphabetic input on 12-key keyboards. You should generally not need to instantiate this yourself; TextKeyListener will do it for you.

As for all implementations of KeyListener, this class is only concerned with hardware keyboards. Software input methods have no obligation to trigger the methods in this class.

Summary

Inherited constants
Public constructors

Public methods
open Int

Return the type of text that this key listener is manipulating, as per android.text.InputType.

open static MultiTapKeyListener!

Returns a new or existing instance with the specified capitalization and correction properties.

open Boolean
onKeyDown(view: View!, content: Editable!, keyCode: Int, event: KeyEvent!)

Handles presses of the meta keys.

open Unit
onSpanAdded(s: Spannable!, what: Any!, start: Int, end: Int)

This method is called to notify you that the specified object has been attached to the specified range of the text.

open Unit
onSpanChanged(buf: Spannable!, what: Any!, s: Int, e: Int, start: Int, stop: Int)

This method is called to notify you that the specified object has been relocated from the range ostart…oend to the new range nstart…nend of the text.

open Unit
onSpanRemoved(s: Spannable!, what: Any!, start: Int, end: Int)

This method is called to notify you that the specified object has been detached from the specified range of the text.

Inherited functions

Public constructors

MultiTapKeyListener

Added in API level 1
MultiTapKeyListener(
    cap: TextKeyListener.Capitalize!,
    autotext: Boolean)

Public methods

getInputType

Added in API level 3
open fun getInputType(): Int

Return the type of text that this key listener is manipulating, as per android.text.InputType. This is used to determine the mode of the soft keyboard that is shown for the editor.

If you return android.text.InputType#TYPE_NULL then no soft keyboard will provided. In other words, you must be providing your own key pad for on-screen input and the key listener will be used to handle input from a hard keyboard.

If you return any other value, a soft input method will be created when the user puts focus in the editor, which will provide a keypad and also consume hard key events. This means that the key listener will generally not be used, instead the soft input method will take care of managing key input as per the content type returned here.

getInstance

Added in API level 1
open static fun getInstance(
    autotext: Boolean,
    cap: TextKeyListener.Capitalize!
): MultiTapKeyListener!

Returns a new or existing instance with the specified capitalization and correction properties.

onKeyDown

Added in API level 1
open fun onKeyDown(
    view: View!,
    content: Editable!,
    keyCode: Int,
    event: KeyEvent!
): Boolean

Handles presses of the meta keys.

onSpanAdded

Added in API level 1
open fun onSpanAdded(
    s: Spannable!,
    what: Any!,
    start: Int,
    end: Int
): Unit

This method is called to notify you that the specified object has been attached to the specified range of the text.

onSpanChanged

Added in API level 1
open fun onSpanChanged(
    buf: Spannable!,
    what: Any!,
    s: Int,
    e: Int,
    start: Int,
    stop: Int
): Unit

This method is called to notify you that the specified object has been relocated from the range ostart…oend to the new range nstart…nend of the text.

onSpanRemoved

Added in API level 1
open fun onSpanRemoved(
    s: Spannable!,
    what: Any!,
    start: Int,
    end: Int
): Unit

This method is called to notify you that the specified object has been detached from the specified range of the text.