1

When the keyboard opens, the default layer is shown with letters

enter image description here

How to do that by default shown a layer with numbers?

enter image description here

uralbash
  • 3,219
  • 5
  • 25
  • 45
  • Does this answer your question? [How can I show on my keyboard only numbers with qt](https://stackoverflow.com/questions/46193913/how-can-i-show-on-my-keyboard-only-numbers-with-qt) – talamaki Jan 25 '22 at 15:21
  • I want a regular keyboard with letters to be available, but when opening it was shown a layer with numbers. In that answer it is proposed to output only a layer with numbers – uralbash Jan 26 '22 at 04:31
  • Reading your question I interpret it asking how to get numbers only mode instead of regular mode. – talamaki Jan 26 '22 at 06:54

1 Answers1

1

Qt virtual keyboard follows inputMethodHints. So, you can e.g. create a form with TextField QML types and set different inputMethodHints for different fields like name, phone number, pin code etc. When you change the field keyboard changes its mode. You can set Qt.ImhDigitsOnly restrictive mode for pin code field to only accept numbers turning keyboard to a keypad.

If your keyboard opens with a number layout in a specific text input field it sounds like Qt.ImhPreferNumbers or something like that is set to inputMethodHints. You could try to figure out who sets the value and test to reset by setting it explicitly to Qt.ImhNone.

talamaki
  • 5,324
  • 1
  • 27
  • 40