English | Site Directory

Android - An Open Handset Alliance Project

android.text.method
public abstract class

android.text.method.MetaKeyInputMethod

java.lang.Object
android.text.method.MetaKeyInputMethod

This base class encapsulates the behavior for handling the meta keys (caps, fn, sym). Input methods 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

      Value  
int  META_ALT_LOCKED    512  0x00000200 
int  META_ALT_ON    0x00000002 
int  META_CAP_LOCKED    256  0x00000100 
int  META_CAP_ON    0x00000001 
int  META_SYM_LOCKED    1024  0x00000400 
int  META_SYM_ON    0x00000004 

Public Constructors

          MetaKeyInputMethod()

Public Methods

      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).
    final  static  int  getMetaState(CharSequence text, int meta)
Gets the state of a particular meta key.
    final  static  int  getMetaState(CharSequence text)
Gets the state of the meta keys.
      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.
        boolean  onKeyDown(View view, Editable content, int keyCode, KeyEvent event)
Handles presses of the meta keys.
        boolean  onKeyUp(View view, Editable content, int keyCode, KeyEvent event)
Handles release of the meta keys.
      static  void  resetMetaState(Spannable text)
Resets all meta state to inactive.

Protected Methods

      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.
Methods inherited from class java.lang.Object

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_CAP_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 MetaKeyInputMethod()

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_CAP_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.
Build m5-rc15g - 14 May 2008 12:50