Most visited

Recently visited

Added in API level 1

QwertyKeyListener

public class QwertyKeyListener
extends BaseKeyListener

java.lang.Object
   ↳ android.text.method.MetaKeyKeyListener
     ↳ android.text.method.BaseKeyListener
       ↳ android.text.method.QwertyKeyListener


这是QWERTY键盘上字母输入的标准关键听众。 通常你不需要自己实例化它; TextKeyListener会为你做。

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

From class android.text.method.MetaKeyKeyListener

Public constructors

QwertyKeyListener(TextKeyListener.Capitalize cap, boolean autoText)

Public methods

int getInputType()
static QwertyKeyListener getInstance(boolean autoText, TextKeyListener.Capitalize cap)

返回具有指定大小写和更正属性的新实例或现有实例。

static QwertyKeyListener getInstanceForFullKeyboard()

获取适用于全键盘的侦听器实例。

static void markAsReplaced(Spannable content, int start, int end, String original)

在自动图文集替换之前,将指定的区域 content为包含 original

boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event)

处理元键的按下。

Inherited methods

From class android.text.method.BaseKeyListener
From class android.text.method.MetaKeyKeyListener
From class java.lang.Object
From interface android.text.method.KeyListener

Public constructors

QwertyKeyListener

Added in API level 1
QwertyKeyListener (TextKeyListener.Capitalize cap, 
                boolean autoText)

Parameters
cap TextKeyListener.Capitalize
autoText boolean

Public methods

getInputType

Added in API level 3
int getInputType ()

Returns
int

getInstance

Added in API level 1
QwertyKeyListener getInstance (boolean autoText, 
                TextKeyListener.Capitalize cap)

返回具有指定大小写和更正属性的新实例或现有实例。

Parameters
autoText boolean
cap TextKeyListener.Capitalize
Returns
QwertyKeyListener

getInstanceForFullKeyboard

Added in API level 11
QwertyKeyListener getInstanceForFullKeyboard ()

获取适用于全键盘的侦听器实例。 禁用自动大写,自动文本和长按启动的屏幕上的字符选择器。

Returns
QwertyKeyListener

markAsReplaced

Added in API level 1
void markAsReplaced (Spannable content, 
                int start, 
                int end, 
                String original)

在自动图文集替换之前,将指定的区域content为包含original 当您完成或即将对文本区域执行自动图文集样式替换并希望让相同的机制(用户在更改后立即按下DEL)撤销替换时调用此方法。

Parameters
content Spannable: the Editable text where the replacement was made
start int: the start of the replaced region
end int: the end of the replaced region; the location of the cursor
original String: the text to be restored if the user presses DEL

onKeyDown

Added in API level 1
boolean onKeyDown (View view, 
                Editable content, 
                int keyCode, 
                KeyEvent event)

处理元键的按下。

Parameters
view View
content Editable
keyCode int
event KeyEvent
Returns
boolean

Hooray!