Most visited

Recently visited

Added in API level 24

KeyboardShortcutInfo

public final class KeyboardShortcutInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.view.KeyboardShortcutInfo


有关键盘快捷键的信息。

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

描述此Parcelable实例的封送表示中包含的特殊对象的种类。

char getBaseCharacter()

返回与修饰符相结合的基本字符,并触发此快捷方式。

int getKeycode()

返回与修饰符一起使用的基本键码,并触发该快捷键。

CharSequence getLabel()

返回用于描述此快捷方式的标签。

int getModifiers()

返回一组修饰符,与该键结合触发此快捷键。

void writeToParcel(Parcel dest, int flags)

将此对象平铺到一个包裹中。

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

描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象将在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。

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

返回与修饰符相结合的基本字符,并触发此快捷方式。 如果键码被设置,则返回MIN_VALUE

Returns
char

getKeycode

Added in API level 24
int getKeycode ()

返回与修饰符一起使用的基本键码,并触发该快捷键。 如果设置了基本字符,则返回KEYCODE_UNKNOWN 有效的键码在KeyEvent中定义为常量。

Returns
int

getLabel

Added in API level 24
CharSequence getLabel ()

返回用于描述此快捷方式的标签。

Returns
CharSequence

getModifiers

Added in API level 24
int getModifiers ()

返回一组修饰符,与该键结合触发此快捷键。 这些可以是组合META_CTRL_ONMETA_SHIFT_ONMETA_META_ONMETA_ALT_ONMETA_FUNCTION_ONMETA_SYM_ON

Returns
int

writeToParcel

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

将此对象平铺到一个包裹中。

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.

Hooray!