Sdílet prostřednictvím


KeyEvent.Number Property

Definition

Gets the number or symbol associated with the key.

public virtual char Number { [Android.Runtime.Register("getNumber", "()C", "GetGetNumberHandler")] get; }
[<get: Android.Runtime.Register("getNumber", "()C", "GetGetNumberHandler")>]
member this.Number : char

Property Value

The associated numeric or symbolic character, or 0 if none.

Attributes

Remarks

Gets the number or symbol associated with the key.

The character value is returned, not the numeric value. If the key is not a number, but is a symbol, the symbol is retuned.

This method is intended to to support dial pads and other numeric or symbolic entry on keyboards where certain keys serve dual function as alphabetic and symbolic keys. This method returns the number or symbol associated with the key independent of whether the user has pressed the required modifier.

For example, on one particular keyboard the keys on the top QWERTY row generate numbers when ALT is pressed such that ALT-Q maps to '1'. So for that keyboard when #getNumber is called with KeyEvent#KEYCODE_Q it returns '1' so that the user can type numbers without pressing ALT when it makes sense.

Java documentation for android.view.KeyEvent.getNumber().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to