### Enumeration

# Gtk InputPurpose

since: 4.0

#### Declaration

    enum Gtk.InputPurpose

#### Description [src]

Describes primary purpose of the input widget.

This information is useful for on-screen keyboards and similar input methods to decide which keys should be presented to the user.

Note that the purpose is not meant to impose a totally strict rule about allowed characters, and does not replace input validation. It is fine for an on-screen keyboard to let the user override the character set restriction that is expressed by the purpose. The application is expected to validate the entry contents, even if it specified a purpose.

The difference between `GTK_INPUT_PURPOSE_DIGITS` and `GTK_INPUT_PURPOSE_NUMBER` is that the former accepts only digits while the latter also some punctuation (like commas or points, plus, minus) and “e” or “E” as in 3.14E+000.

This enumeration may be extended in the future; input methods should interpret unknown values as “free form”.

Available since: 4.0

#### Members

`GTK_INPUT_PURPOSE_FREE_FORM`

  Allow any character.

  - Value: `0`
  - Nickname: `free-form`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_ALPHA`

  Allow only alphabetic characters.

  - Value: `1`
  - Nickname: `alpha`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_DIGITS`

  Allow only digits.

  - Value: `2`
  - Nickname: `digits`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_NUMBER`

  Edited field expects numbers.

  - Value: `3`
  - Nickname: `number`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_PHONE`

  Edited field expects phone number.

  - Value: `4`
  - Nickname: `phone`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_URL`

  Edited field expects URL.

  - Value: `5`
  - Nickname: `url`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_EMAIL`

  Edited field expects email address.

  - Value: `6`
  - Nickname: `email`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_NAME`

  Edited field expects the name of a person.

  - Value: `7`
  - Nickname: `name`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_PASSWORD`

  Like `GTK_INPUT_PURPOSE_FREE_FORM`, but characters are hidden.

  - Value: `8`
  - Nickname: `password`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_PIN`

  Like `GTK_INPUT_PURPOSE_DIGITS`, but characters are hidden.

  - Value: `9`
  - Nickname: `pin`
  - Available since: 4.0
`GTK_INPUT_PURPOSE_TERMINAL`

  Allow any character, in addition to control codes.

  - Value: `10`
  - Nickname: `terminal`
  - Available since: 4.0