public class MultiTapKeyListener extends BaseKeyListener implements SpanWatcher
KeyListener
, this class is only concerned
with hardware keyboards. Software input methods have no obligation to trigger
the methods in this class.NoCopySpan.Concrete
META_ALT_LOCKED, META_ALT_ON, META_CAP_LOCKED, META_SELECTING, META_SHIFT_ON, META_SYM_LOCKED, META_SYM_ON
Constructor and Description |
---|
MultiTapKeyListener(TextKeyListener.Capitalize cap,
boolean autotext) |
Modifier and Type | Method and Description |
---|---|
int |
getInputType()
Return the type of text that this key listener is manipulating,
as per
InputType . |
static MultiTapKeyListener |
getInstance(boolean autotext,
TextKeyListener.Capitalize cap)
Returns a new or existing instance with the specified capitalization
and correction properties.
|
boolean |
onKeyDown(View view,
Editable content,
int keyCode,
KeyEvent event)
Handles presses of the meta keys.
|
void |
onSpanAdded(Spannable s,
Object what,
int start,
int end)
This method is called to notify you that the specified object
has been attached to the specified range of the text.
|
void |
onSpanChanged(Spannable buf,
Object what,
int s,
int e,
int start,
int stop)
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. |
void |
onSpanRemoved(Spannable s,
Object what,
int start,
int end)
This method is called to notify you that the specified object
has been detached from the specified range of the text.
|
backspace, forwardDelete, onKeyOther
adjustMetaAfterKeypress, adjustMetaAfterKeypress, clearMetaKeyState, clearMetaKeyState, clearMetaKeyState, 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, onKeyUp
public MultiTapKeyListener(TextKeyListener.Capitalize cap, boolean autotext)
public static MultiTapKeyListener getInstance(boolean autotext, TextKeyListener.Capitalize cap)
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 content, int keyCode, KeyEvent event)
MetaKeyKeyListener
onKeyDown
in interface KeyListener
onKeyDown
in class BaseKeyListener
public void onSpanChanged(Spannable buf, Object what, int s, int e, int start, int stop)
SpanWatcher
ostart…oend
to the new range nstart…nend
of the text.onSpanChanged
in interface SpanWatcher
public void onSpanAdded(Spannable s, Object what, int start, int end)
SpanWatcher
onSpanAdded
in interface SpanWatcher
public void onSpanRemoved(Spannable s, Object what, int start, int end)
SpanWatcher
onSpanRemoved
in interface SpanWatcher