Skip to content

Most visited

Recently visited

navigation

KeyboardShortcutInfo

public final class KeyboardShortcutInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.view.KeyboardShortcutInfo


Information about a Keyboard Shortcut.

Summary

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<KeyboardShortcutInfo> CREATOR

Public constructors

KeyboardShortcutInfo(CharSequence label, int keycode, int modifiers)
KeyboardShortcutInfo(CharSequence label, char baseCharacter, int modifiers)

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

char getBaseCharacter()

Returns the base character that, combined with the modifiers, triggers this shortcut.

int getKeycode()

Returns the base keycode that, combined with the modifiers, triggers this shortcut.

CharSequence getLabel()

Returns the label to be used to describe this shortcut.

int getModifiers()

Returns the set of modifiers that, combined with the key, trigger this shortcut.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Fields

CREATOR

added in API level 24
Creator<KeyboardShortcutInfo> CREATOR

Public constructors

KeyboardShortcutInfo

added in API level 24
KeyboardShortcutInfo (CharSequence label, 
                int keycode, 
                int modifiers)

Parameters
label CharSequence: The label that identifies the action performed by this shortcut.

keycode int: The keycode that triggers the shortcut. This should be a valid constant defined in KeyEvent.

modifiers int: The set of modifiers that, combined with the key, trigger the shortcut. These should be a combination of META_CTRL_ON, META_SHIFT_ON, META_META_ON, META_ALT_ON, META_FUNCTION_ON and META_SYM_ON.

KeyboardShortcutInfo

added in API level 24
KeyboardShortcutInfo (CharSequence label, 
                char baseCharacter, 
                int modifiers)

Parameters
label CharSequence: The label that identifies the action performed by this shortcut.

baseCharacter char: The character that triggers the shortcut.

modifiers int: The set of modifiers that, combined with the key, trigger the shortcut. These should be a combination of META_CTRL_ON, META_SHIFT_ON, META_META_ON, META_ALT_ON, META_FUNCTION_ON and META_SYM_ON.

Public methods

describeContents

added in API level 24
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getBaseCharacter

added in API level 24
char getBaseCharacter ()

Returns the base character that, combined with the modifiers, triggers this shortcut. If the keycode was set instead, returns MIN_VALUE.

Returns
char

getKeycode

added in API level 24
int getKeycode ()

Returns the base keycode that, combined with the modifiers, triggers this shortcut. If the base character was set instead, returns KEYCODE_UNKNOWN. Valid keycodes are defined as constants in KeyEvent.

Returns
int

getLabel

added in API level 24
CharSequence getLabel ()

Returns the label to be used to describe this shortcut.

Returns
CharSequence

This value may be null.

getModifiers

added in API level 24
int getModifiers ()

Returns the set of modifiers that, combined with the key, trigger this shortcut. These can be a combination of META_CTRL_ON, META_SHIFT_ON, META_META_ON, META_ALT_ON, META_FUNCTION_ON and META_SYM_ON.

Returns
int

writeToParcel

added in API level 24
void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.

flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

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

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

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.