public class DialerKeyListener extends NumberKeyListener
KeyListener
, this class is only concerned
with hardware keyboards. Software input methods have no obligation to trigger
the methods in this class.InputFilter.AllCaps, InputFilter.LengthFilter
Modifier and Type | Field and Description |
---|---|
static char[] |
CHARACTERS
The characters that are used.
|
META_ALT_LOCKED, META_ALT_ON, META_CAP_LOCKED, META_SELECTING, META_SHIFT_ON, META_SYM_LOCKED, META_SYM_ON
Constructor and Description |
---|
DialerKeyListener() |
Modifier and Type | Method and Description |
---|---|
protected char[] |
getAcceptedChars()
You can say which characters you can accept.
|
int |
getInputType()
Return the type of text that this key listener is manipulating,
as per
InputType . |
static DialerKeyListener |
getInstance() |
protected int |
lookup(KeyEvent event,
Spannable content)
Overrides the superclass's lookup method to prefer the number field
from the KeyEvent.
|
filter, ok, onKeyDown
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 static final char[] CHARACTERS
KeyEvent.getMatch(char[])
,
getAcceptedChars()
protected char[] getAcceptedChars()
NumberKeyListener
getAcceptedChars
in class NumberKeyListener
public static DialerKeyListener getInstance()
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.
protected int lookup(KeyEvent event, Spannable content)
lookup
in class NumberKeyListener