android.text.method
public
abstract
class
android.text.method.MetaKeyKeyListener
This base class encapsulates the behavior for handling the meta keys
(caps, fn, sym). Key listener that care about meta state should
inherit from it; you should not instantiate this class directly in a client.
Known Direct Subclasses
Known Indirect Subclasses
Summary
Constants
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
int
META_ALT_LOCKED
Constant Value:
512
(0x00000200)
public
static
final
int
META_ALT_ON
Constant Value:
2
(0x00000002)
public
static
final
int
META_CAP_LOCKED
Constant Value:
256
(0x00000100)
public
static
final
int
META_SHIFT_ON
Constant Value:
1
(0x00000001)
public
static
final
int
META_SYM_LOCKED
Constant Value:
1024
(0x00000400)
public
static
final
int
META_SYM_ON
Constant Value:
4
(0x00000004)
Public Constructors
public
MetaKeyKeyListener()
Public Methods
public
static
void
adjustMetaAfterKeypress(Spannable content)
Call this method after you handle a keypress so that the meta
state will be reset to unshifted (if it is not still down)
or primed to be reset to unshifted (once it is released).
public
static
final
int
getMetaState(CharSequence text, int meta)
Gets the state of a particular meta key.
Parameters
text
| the buffer in which the meta key would have been pressed. |
meta
| META_SHIFT_ON, META_ALT_ON, or META_SYM_ON |
Returns
- 0 if inactive, 1 if active, 2 if locked.
public
static
final
int
getMetaState(CharSequence text)
Gets the state of the meta keys.
Parameters
text
| the buffer in which the meta key would have been pressed. |
Returns
- an integer in which each bit set to one represents a pressed
or locked meta key.
public
static
boolean
isMetaTracker(CharSequence text, Object what)
Returns true if this object is one that this class would use to
keep track of meta state in the specified text.
public
boolean
onKeyDown(View view, Editable content, int keyCode, KeyEvent event)
Handles presses of the meta keys.
public
boolean
onKeyUp(View view, Editable content, int keyCode, KeyEvent event)
Handles release of the meta keys.
public
static
void
resetMetaState(Spannable text)
Resets all meta state to inactive.
Protected Methods
protected
static
void
resetLockedMeta(Spannable content)
Call this if you are a method that ignores the locked meta state
(arrow keys, for example) and you handle a key.