Events > Input


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


Universal

Keyboard

event-key-press-release

Triggers when any Control is pressed or released.


Any Key

event-key-any-press-release

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

event-focus-changed

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

event-mouse-press-release

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

event-mouse-enter-exit-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

event-mouse-enter-exit-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

event-device-swipe

Triggers whenever the device is swiped in the specified direction.


Multi-Touch

event-device-multitouch

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)

event-gamepad-any-press-release

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.