Show Virtual Keyboard Icon Show Virtual Keyboard

This action can be used to show the virtual keyboard on the device running the game. When you call this action you will be asked to provide one of the following constants for each of the first three arguments:

The last argument is to enable/disable predictive text, and this would be set to true to permit it, and false otherwise, but note that just because it is permitted doesn't mean that it will be used as that will depend on the preferences of the user on the device. When in predictive text mode, the virtual keyboard will not generate normal GameMaker key-press events. Instead, it will only update the last character pressed and keyboard string variables. This is due to the inability to detect whether a change in the internal text field used for detecting key presses came from an actual virtual keyboard key, or a text suggestion. In these cases you would want to read the keyboard_string input as opposed to reading any kind of raw key input.

It is important to note too that the user will get different keyboards with different capabilities depending on the platform OS, with the following caveats for use per target:

Calling this function will generate a System Asynchronous Event, in which the async_load DS map will be populated with the following key/value pairs:

 

Action Syntax:

Show Virtual Keyboard Action

Arguments:

 

ArgumentDescription
keyboard_typeDetermines the key-set available on the virtual keyboard.
return_key_typeDetermines what is shown on the return/action key of the virtual keyboard.
autocapitalization_typeDetermines how/if the words typed via the virtual keyboard will be autocapitalized.
predictive_text_enabledSet to true/false to enable/disable predictive text input.

 

Example:

Show Virtual Keyboard ExampleThe above action block code checks for a mouse down action, and if one is detected, then a check is performed to see if the OS virtual keyboard is showing. If it isn't then it is set to show - using a numeric keypad type - and if is already showing then it is hidden.