pub enum KeyboardType {
Show 13 variants
Text,
Multiline,
Number,
Decimal,
Phone,
Email,
Url,
Password,
VisiblePassword,
Name,
StreetAddress,
DateTime,
None,
}Expand description
Which keys the software keyboard should offer.
The platform decides what that means: a phone keypad on Android and iOS, and nothing at all on a desktop, which has one keyboard and it is already open.
Variants§
Text
Ordinary text, with suggestions and composition. The default.
Multiline
Text over several lines, where the action key is a newline.
Number
Whole numbers.
Decimal
Numbers with a decimal separator and a sign.
Phone
A telephone keypad: digits, +, *, #.
An email address: an @ and a . within reach, and no auto-capitalisation.
Url
A URL: a / and a .com within reach.
Password
A secret. The keyboard neither learns it nor suggests it, which is the whole point and is not something the masking dots can do on their own.
VisiblePassword
A secret the field shows in the clear — a one-time code, a generated passphrase being checked. Still never learned.
Name
A person’s name: each word capitalised, no sentence casing.
StreetAddress
A postal address.
DateTime
A date or a time.
None
No software keyboard: the field is edited some other way — a picker, a scanner, a hardware keyboard only.
Implementations§
Source§impl KeyboardType
impl KeyboardType
Sourcepub const fn android_input_type(self) -> i32
pub const fn android_input_type(self) -> i32
The Android InputType bit field for this keyboard.
None is TYPE_NULL, which is zero — the value that tells
Android there is nothing to type into. It is also what the bridge produced for
every field before it had an InputType at all, which is why a keyboard used
to arrive with no composition, no swipe and no CJK.
Sourcepub const fn is_secret(self) -> bool
pub const fn is_secret(self) -> bool
Whether the keyboard must never learn what is typed into it.
Android infers this from the variation bits, so nothing else has to be sent —
but the question is worth asking in this vocabulary too, because it is the
reason Password exists as a type rather than as a way of
drawing dots.