public static class TextViewBindingObject.KeyListener1 extends Object implements KeyListener
Constructor and Description |
---|
KeyListener1() |
Modifier and Type | Method and Description |
---|---|
void |
clearMetaKeyState(View view,
Editable content,
int states)
Remove the given shift states from the edited text.
|
int |
getInputType()
Return the type of text that this key listener is manipulating,
as per
InputType . |
boolean |
onKeyDown(View view,
Editable text,
int keyCode,
KeyEvent event)
If the key listener wants to handle this key, return true,
otherwise return false and the caller (i.e.
|
boolean |
onKeyOther(View view,
Editable text,
KeyEvent event)
If the key listener wants to other kinds of key events, return true,
otherwise return false and the caller (i.e.
|
boolean |
onKeyUp(View view,
Editable text,
int keyCode,
KeyEvent event)
If the key listener wants to handle this key release, return true,
otherwise return false and the caller (i.e.
|
public int getInputType()
KeyListener
InputType
. This is used to
determine the mode of the soft keyboard that is shown for the editor.
If you return
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.
getInputType
in interface KeyListener
public boolean onKeyDown(View view, Editable text, int keyCode, KeyEvent event)
KeyListener
onKeyDown
in interface KeyListener
public boolean onKeyUp(View view, Editable text, int keyCode, KeyEvent event)
KeyListener
onKeyUp
in interface KeyListener
public boolean onKeyOther(View view, Editable text, KeyEvent event)
KeyListener
onKeyOther
in interface KeyListener
public void clearMetaKeyState(View view, Editable content, int states)
KeyListener
clearMetaKeyState
in interface KeyListener