Events > Input


Read our articles on Controls, Touch & Gestures and Gamepads for more information on handling user input.


Universal

Keyboard

when control is pressed

Triggers when any Control is pressed or released.


Any Key

when any key is pressed

Triggers when any key is pressed/released (even those not mapped to controls). This is useful for creating user input fields.

The embedded key code block tells you the hardware code for the key. This is useful for special keys (such as backspace, enter, etc.) that can't be recognized as a letter or number.

example

The embedded character block tells you what letter, number or character was pressed, if one was pressed.


Focus

when the game loses focus

Triggers when the game gains/loses focus. Useful for mobile apps for telling when your game has been sent to the background and later resumed.


Universal (Works for Mouse & Touch)

Clicked / Moved

when the mouse is pressed

Triggers whenever the mouse pressed/released/moved/dragged. For mobile-devices, triggers whenever a finger touches, releases or is dragged around the screen.


Clicked / Moved on Actor

when the mouse enters actor

Triggers whenever the mouse enters/exits/presses/releases/drags on an actor. For mobile-devices, triggers whenever a finger touches, releases or drags an actor.


Clicked / Moved on Region

when the mouse enters region

Triggers whenever the mouse enters/exits/presses/releases/drags on a region. For mobile-devices, triggers whenever a finger touches, releases or drags a region.


Mobile-Only

Swipe

when the device is swiped up

Triggers whenever the device is swiped in the specified direction.


Multi-Touch

when touch is started

Detects multi-touch events. Use the mouse events for regular, single-touch detection. The embedded block tells you the position of the touch and the ID of the touch (so you can track a touch throughout its lifecycle).

Useful for on-screen virtual buttons (use the On Screen Button that we ship with Stencyl) or air hockey like games that require detection of independent finger motions.


Desktop-Only

Any Button (Gamepad)

when any gamepad button is pressed

Triggers when any gamepad button pressed/released.

Read our Gamepad article for further details -- you are not meant to use this to implement gamepad controls, only to detect what controls to map to or to build a control configuration component.