public abstract class BaseKeyListener extends MetaKeyKeyListener implements KeyListener
onKeyDown(android.view.View, android.text.Editable, int, android.view.KeyEvent)
and MetaKeyKeyListener.onKeyUp(android.view.View, android.text.Editable, int, android.view.KeyEvent)
to insert
characters as keys are pressed.
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.META_ALT_LOCKED, META_ALT_ON, META_CAP_LOCKED, META_SELECTING, META_SHIFT_ON, META_SYM_LOCKED, META_SYM_ON
Constructor and Description |
---|
BaseKeyListener() |
Modifier and Type | Method and Description |
---|---|
boolean |
backspace(View view,
Editable content,
int keyCode,
KeyEvent event)
Performs the action that happens when you press the
KeyEvent.KEYCODE_DEL key in
a TextView . |
boolean |
forwardDelete(View view,
Editable content,
int keyCode,
KeyEvent event)
Performs the action that happens when you press the
KeyEvent.KEYCODE_FORWARD_DEL
key in a TextView . |
boolean |
onKeyDown(View view,
Editable content,
int keyCode,
KeyEvent event)
Handles presses of the meta keys.
|
boolean |
onKeyOther(View view,
Editable content,
KeyEvent event)
Base implementation handles ACTION_MULTIPLE KEYCODE_UNKNOWN by inserting
the event's text into the content.
|
adjustMetaAfterKeypress, adjustMetaAfterKeypress, clearMetaKeyState, clearMetaKeyState, clearMetaKeyState, getMetaState, getMetaState, getMetaState, getMetaState, getMetaState, getMetaState, handleKeyDown, handleKeyUp, isMetaTracker, isSelectingMetaTracker, onKeyUp, resetLockedMeta, resetLockedMeta, resetMetaState, startSelecting, stopSelecting
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearMetaKeyState, getInputType, onKeyUp
public boolean backspace(View view, Editable content, int keyCode, KeyEvent event)
KeyEvent.KEYCODE_DEL
key in
a TextView
. If there is a selection, deletes the selection; otherwise,
deletes the character before the cursor, if any; ALT+DEL deletes everything on
the line the cursor is on.public boolean forwardDelete(View view, Editable content, int keyCode, KeyEvent event)
KeyEvent.KEYCODE_FORWARD_DEL
key in a TextView
. If there is a selection, deletes the selection; otherwise,
deletes the character before the cursor, if any; ALT+FORWARD_DEL deletes everything on
the line the cursor is on.public boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event)
MetaKeyKeyListener
onKeyDown
in interface KeyListener
onKeyDown
in class MetaKeyKeyListener
public boolean onKeyOther(View view, Editable content, KeyEvent event)
onKeyOther
in interface KeyListener