public final class KeyboardShortcutInfo
extends Object implements Parcelable
| java.lang.Object | |
| android.view.KeyboardShortcutInfo | |
有关键盘快捷键的信息。
Inherited constants |
|---|
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) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
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 (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. |
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. |
char getBaseCharacter ()
返回与修饰符相结合的基本字符,并触发此快捷方式。 如果键码被设置,则返回MIN_VALUE 。
| 返回(Returns) | |
|---|---|
char |
|
int getKeycode ()
返回与修饰符一起使用的基本键码,并触发该快捷键。 如果设置了基本字符,则返回KEYCODE_UNKNOWN 。 有效的键码在KeyEvent中定义为常量。
| 返回(Returns) | |
|---|---|
int |
|
int getModifiers ()
返回一组修饰符,与该键结合触发此快捷键。 这些可以是组合META_CTRL_ON , META_SHIFT_ON , META_META_ON , META_ALT_ON , META_FUNCTION_ON和META_SYM_ON 。
| 返回(Returns) | |
|---|---|
int |
|
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. |