Virtual Keys

Here you can find out how device virtual keys are used.

In order for your games to work properly on mobile devices with a touch screen, you may need to be able to assign areas of the screen to respond to certain things when they are touched by the user. This is done by assigning a "virtual Key" to an internally mapped standard keyboard key and then using the keyboard events that they generate to control your application. It is worth noting that these "virtual keys" are mapped to the screen position rather than room position and so the x/y values are absolute, based on the display size. This means that you don't need to worry about the use of views or the relative room coordinates, and can simply draw your key sprites and define your virtual keys in the Draw GUI Event of an object.

NOTE: These functions will not work on the Windows, Ubuntu (Linux), nor the MacOS, target platforms!

The available virtual key functions are:

  1. virtual_key_add
  2. virtual_key_show
  3. virtual_key_hide
  4. virtual_key_delete


Back: Mouse, Keyboard and Other Controls
© Copyright YoYo Games Ltd. 2018 All Rights Reserved