一、Keyboard.Key doc位置
本地:%ANDROID_HOME%/sdk/docs/reference/android/inputmethodservice/Keyboard.Key.html
Web:
二、Keyboard.Key doc内容
Keyboard.Key
extends Objectjava.lang.Object | |
↳ | android.inputmethodservice.Keyboard.Key |
Class Overview
Class for describing the position and characteristics of a single key in the keyboard.
Summary
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Attribute Name | Related Method | Description | |||||||||
android:codes | The unicode value or comma-separated values that this key outputs. | ||||||||||
android:horizontalGap | Default horizontal gap between keys. | ||||||||||
android:iconPreview | The icon to show in the popup preview. | ||||||||||
android:isModifier | Whether this is a modifier key such as Alt or Shift. | ||||||||||
android:isRepeatable | Whether long-pressing on this key will make it repeat. | ||||||||||
android:isSticky | Whether this is a toggle key. | ||||||||||
android:keyEdgeFlags | Key edge flags. | ||||||||||
android:keyHeight | Default height of a key, in pixels or percentage of display width. | ||||||||||
android:keyIcon | The icon to display on the key instead of the label. | ||||||||||
android:keyLabel | The label to display on the key. | ||||||||||
android:keyOutputText | The string of characters to output when this key is pressed. | ||||||||||
android:keyWidth | Default width of a key, in pixels or percentage of display width. | ||||||||||
android:popupCharacters | The characters to display in the popup keyboard. | ||||||||||
android:popupKeyboard | The XML keyboard layout of any popup keyboard. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public int[] | codes | All the key codes (unicode or custom code) that this key could generate, zero'th being the most important. | |||||||||
public int | edgeFlags | Flags that specify the anchoring to edges of the keyboard for detecting touch events that are just out of the boundary of the key. | |||||||||
public int | gap | The horizontal gap before this key | |||||||||
public int | height | Height of the key, not including the gap | |||||||||
public Drawable | icon | Icon to display instead of a label. | |||||||||
public Drawable | iconPreview | Preview version of the icon, for the preview popup | |||||||||
public CharSequence | label | Label to display | |||||||||
public boolean | modifier | Whether this is a modifier key, such as Shift or Alt | |||||||||
public boolean | on | If this is a sticky key, is it on? | |||||||||
public CharSequence | popupCharacters | Popup characters | |||||||||
public int | popupResId | If this key pops up a mini keyboard, this is the resource id for the XML layout for that keyboard. | |||||||||
public boolean | pressed | The current pressed state of this key | |||||||||
public boolean | repeatable | Whether this key repeats itself when held down | |||||||||
public boolean | sticky | Whether this key is sticky, i.e., a toggle key | |||||||||
public CharSequence |