Original Author Paul Laughton, 2011
Page 103
De Re BASIC!
If the keyboard is not showing, and you have an OnKbChange: interrupt label, BASIC! will jump to your
interrupt label when the keyboard opens.
When the soft keyboard is showing, its keys may be read using the Inkey$ command. The command may
not work in devices with hard or slide-out keyboards.
You cannot show the soft keyboard over the Output Console unless you first Print to the Console.
Kb.toggle
Toggles the showing or hiding of the soft keyboard. If the keyboard is being shown, it will be hidden. If it
is hidden, it will be shown.
Kb.showing <lvar>
Reports the visibility of the soft keyboard. If the keyboard is showing, the <lvar> is set to 1.0 (true),
otherwise the <lvar> is set to 0.0 (false).
This command reports only the status of the keyboard shown by Kb.show. For example, the keyboard
attached to the Input command dialog box cannot be controlled by Kb.show or Kb.hide and its status is
not reported by Kb.showing.
OnKbChange:
If you show a soft keyboard with Kb.show, or close that same keyboard with Kb.hide or by tapping the
BACK key, the change takes some time. The keyboard may open or close a few hundred milliseconds
after it is requested. Kb.show and Kb.hide block until the change is complete, but your program does
not know when you tap the BACK key.
If you have an OnKbChange: interrupt label in your program, then when the keyboard changes as just
described, BASIC! interrupts your program and executes the statements after the interrupt label.
To return control to where the interrupt occurred, execute Kb.resume in your interrupt handler.
This interrupt occurs only for keyboards you show with Kb.show. Keyboards attached to other screens,
such as TGet or the Input dialog box, do not cause OnKbChange: interrupts.
Kb.resume
Resume program execution at the point where the OnKbChange: interrupt occurred.
When an interrupt occurs, no other interrupt can occur (except OnError:) until the corresponding
resume executes.
The Soft Keyboard and the BACK Key
If you show a soft keyboard with Kb.show, and you tap the BACK key, the keyboard closes. The current
screen (Console or Graphics screen) does not close. BASIC! does not trap the keypress with either
OnBackKey: or OnKeyPress:. You can use the OnKbChange: interrupt label to be notified that the
keyboard closed.