Skip to content

Most visited

Recently visited

navigation

KeyEventCompat

public final class KeyEventCompat
extends Object

java.lang.Object
   ↳ android.support.v4.view.KeyEventCompat


Helper for accessing features in KeyEvent introduced after API level 4 in a backwards compatible fashion.

Summary

Public methods

static boolean dispatch(KeyEvent event, KeyEvent.Callback receiver, Object state, Object target)

This method is deprecated. Call dispatch(KeyEvent.Callback, KeyEvent.DispatcherState, Object) directly. This method will be removed in a future release.

static Object getKeyDispatcherState(View view)

This method is deprecated. Call getKeyDispatcherState() directly. This method will be removed in a future release.

static boolean hasModifiers(KeyEvent event, int modifiers)
static boolean hasNoModifiers(KeyEvent event)
static boolean isCtrlPressed(KeyEvent event)
static boolean isTracking(KeyEvent event)

This method is deprecated. Call isTracking() directly. This method will be removed in a future release.

static boolean metaStateHasModifiers(int metaState, int modifiers)
static boolean metaStateHasNoModifiers(int metaState)
static int normalizeMetaState(int metaState)
static void startTracking(KeyEvent event)

This method is deprecated. Call startTracking() directly. This method will be removed in a future release.

Inherited methods

From class java.lang.Object

Public methods

dispatch

boolean dispatch (KeyEvent event, 
                KeyEvent.Callback receiver, 
                Object state, 
                Object target)

This method is deprecated.
Call dispatch(KeyEvent.Callback, KeyEvent.DispatcherState, Object) directly. This method will be removed in a future release.

Parameters
event KeyEvent
receiver KeyEvent.Callback
state Object
target Object
Returns
boolean

getKeyDispatcherState

Object getKeyDispatcherState (View view)

This method is deprecated.
Call getKeyDispatcherState() directly. This method will be removed in a future release.

Parameters
view View
Returns
Object

hasModifiers

boolean hasModifiers (KeyEvent event, 
                int modifiers)

Parameters
event KeyEvent
modifiers int
Returns
boolean

hasNoModifiers

boolean hasNoModifiers (KeyEvent event)

Parameters
event KeyEvent
Returns
boolean

isCtrlPressed

boolean isCtrlPressed (KeyEvent event)

Parameters
event KeyEvent
Returns
boolean

isTracking

boolean isTracking (KeyEvent event)

This method is deprecated.
Call isTracking() directly. This method will be removed in a future release.

Parameters
event KeyEvent
Returns
boolean

metaStateHasModifiers

boolean metaStateHasModifiers (int metaState, 
                int modifiers)

Parameters
metaState int
modifiers int
Returns
boolean

metaStateHasNoModifiers

boolean metaStateHasNoModifiers (int metaState)

Parameters
metaState int
Returns
boolean

normalizeMetaState

int normalizeMetaState (int metaState)

Parameters
metaState int
Returns
int

startTracking

void startTracking (KeyEvent event)

This method is deprecated.
Call startTracking() directly. This method will be removed in a future release.

Parameters
event KeyEvent
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.