Easy Input System
The bittyBIG Easy Input System gives Stencyl one unified input layer for keyboard, mouse, gamepads, touch, mobile gestures, device motion, and virtual controls. Build named Actions once, assign Input Sources to them, then choose an Action Map per Input Slot.
Project Setup in Stencyl
1. Install and enable the extension
- Open Settings → Extensions.
- Install bittyBIG Easy Input System.
- Enable it for the project.
2. Use the Easy Input palette
The extension initializes its input backends automatically. You do not need to create a separate manager Actor just to begin using the public blocks.
Create an Action Map, make it active while defining Actions, then assign the map to one or more Input Slots.
Core Concepts
Input Source — A typed description of an input that can be assigned to an Action. Sources can be digital/button, analog/scalar, or vector.
Device Source — Identifies an entire input device rather than a single input. Device Sources include Keyboard, Mouse, Virtual Controls, and a controller at a specific physical Port. Use Set to assign a device exclusively to an Input Slot, Add to share it with another slot, or Remove to stop routing it to a slot without changing its other assignments.
Action — A gameplay-facing name such as Jump, Shoot, Move, Aim, or Pause. Game logic should usually read Actions instead of physical devices.
Action Map — A named collection of Action definitions and their bindings.
Active Action Map — The map currently being edited by Set Action and Digital Vector setup blocks. This is separate from the map an Input Slot is using.
Input Slot — A player/input routing destination that can receive one or more devices. Entire Device Sources and individual Input Sources can be assigned, shared, or rerouted between slots. Each Input Slot can use its own Action Map.
Digital Input — On/off input with Down, Pressed, and Released state.
Analog Input — One numeric value, such as a trigger, stick axis, mouse delta, or Motion axis.
Vector Input — Two numeric components, X and Y, such as a stick, mouse movement, Motion pair, or Digital Vector.
Digital Vector — Four digital directions combined into a Vector Action. Each direction can contain more than one digital input.
Combination Inputs — Multiple digital Input Sources that must all be held together for the Action to be Down.
Raw Input — Physical/device-level values and lifecycle events. Useful for drawing, custom touch logic, diagnostics, or behavior that the Action layer does not model.
Gesture Input — Higher-level interpretation of touch or device movement. One-shot gestures pulse Pressed/Released; Hold and Drag remain Down until they end.
Platform Notes
| Area | Current behavior |
|---|---|
| Keyboard / Mouse | OpenFL/Stencyl keyboard and mouse input. Mouse position is reported in stage coordinates; movement/wheel values are accumulated per frame. |
| Gamepads | Normalized digital buttons, analog sticks/triggers, vectors, connection events, controller Name/ID, and up to the system’s configured Input Slots. Deadzones are currently global rather than per Input Slot. |
| Touch | Uses OpenFL multi-touch IDs and stage coordinates. Virtual controls consume their owned touches before raw Touch events and gesture recognition, preventing duplicate input. |
| Android Motion | Acceleration uses the raw accelerometer stream. Motion uses Android linear acceleration with gravity removed and normalized to g. Orientation uses TYPE_ROTATION_VECTOR. Gyro uses raw TYPE_GYROSCOPE radians/second. |
| Other Motion targets | The OpenFL accelerometer path remains available where supported. The native iOS Core Motion Gyro/Orientation bridge is intentionally not implemented in this version; hooks/comments are retained for later work. |
Blocks & Events
This reference mirrors the current Easy Input event menu and Stencyl palette. Each entry shows the block or event, what it does, and what each visible part means.
How to read the blocks
Dropdown — chooses a mode, state, input, property, or operation.
Text field — usually a name such as an Action, Action Map, Digital Vector, or virtual control.
Number/value field — supplies a slot, position, size, threshold, or other numeric value.
Input Source reporter — describes a digital, analog, or vector input and can be plugged into compatible Action/Vector blocks.
Attached event reporter — data from that exact event callback; its meaning is listed directly in the event's Parts line.
Events
Any Input
When Any Input is
scripts.BittyInputBlocks.registerInputEventListener(${eventRef});
// condition: inputPhase == #0Touch
When a Touch
scripts.BittyInputBlocks.registerTouchEventListener(${eventRef});
// condition: touchPhase == #0Any Touch Gesture
When Any Touch Gesture
scripts.BittyInputBlocks.registerTouchGestureEventListener(${eventRef});Any Device Gesture
When Any Device Gesture
scripts.BittyInputBlocks.registerDeviceGestureEventListener(${eventRef});Controller
When a Controller
scripts.BittyInputBlocks.registerControllerEventListener(${eventRef});
// condition: controllerConnected == #0Analog Input
When an Analog Input Changes
scripts.BittyInputBlocks.registerAnalogEventListener(${eventRef});Action
When Action is for
scripts.BittyInputBlocks.registerActionEventListener(${eventRef}, this);
// condition: action == #0 && actionPhase == #1 && (#2 == "Any" || controllerPort == Std.int(#3))Input Logic
State
Input Source State
scripts.BittyInputBlocks.getInputSourceState(~,~)
Input Source State by Slot
scripts.BittyInputBlocks.getInputSourceState(~,~,~)
Actions
Action is for Input Slot
scripts.BittyInputBlocks.getActionState(~,~,~)
Get Value of Action for Input Slot
scripts.BittyInputBlocks.getActionValue(~,~,~)
Set Action to
scripts.BittyInputBlocks.setAction(~,~);
Digital Vector
scripts.BittyInputBlocks.inputSourceDigitalVector(~)
Combination Inputs
scripts.BittyInputBlocks.combineInputs(~,~)
Action Maps
Action Map Operation
scripts.BittyInputBlocks.actionMapOperation(~,~);
Set Input Slot Action Map to
scripts.BittyInputBlocks.setInputSlotActionMap(~,~);
Get Action Map for Input Slot
scripts.BittyInputBlocks.getInputSlotActionMap(~)
Get Active Action Map
scripts.BittyInputBlocks.getActiveActionMap()
Digital Vectors
Create Digital Vector
scripts.BittyInputBlocks.createDigitalVector(~);
Create Digital Vector Up Down Left Right
scripts.BittyInputBlocks.createDigitalVectorDirections(~,~,~,~,~);
Add to of Digital Vector
scripts.BittyInputBlocks.addDigitalVectorInput(~,~,~);
Clear Digital Vector
scripts.BittyInputBlocks.clearDigitalVector(~);
Kb & M
Inputs
Keyboard
scripts.BittyInputBlocks.inputSourceKeyboard(~)
Keyboard Common / Symbol
scripts.BittyInputBlocks.inputSourceKeyboard(~)
Keyboard Function Key
scripts.BittyInputBlocks.inputSourceKeyboard(~)
Mouse
scripts.BittyInputBlocks.inputSourceMouse(~)
Mouse Analog
scripts.BittyInputBlocks.inputSourceMouseAnalog(~)
Mouse Vector
scripts.BittyInputBlocks.inputSourceMouseVector(~)
Mouse
Get Mouse
scripts.BittyInputBlocks.getMouseValue(~)
Get Mouse Delta
scripts.BittyInputBlocks.getMouseDelta(~)
Get Mouse Wheel
scripts.BittyInputBlocks.getMouseWheel()
Gamepads
Inputs
Controller
scripts.BittyInputBlocks.inputSourceController(~)
Controller Analog
scripts.BittyInputBlocks.inputSourceControllerAnalog(~)
Controller Vector
scripts.BittyInputBlocks.inputSourceControllerVector(~)
Properties
Controller is connected at Port
scripts.BittyInputBlocks.isControllerConnected(~)
Get for Controller Port
scripts.BittyInputBlocks.getControllerNumber(~,~)
Set Deadzone to
scripts.BittyInputBlocks.setDeadzone(~,~);
Get Connected Controller Count
scripts.BittyInputBlocks.getConnectedControllerCount()
Get Controller for Port
scripts.BittyInputBlocks.getControllerText(~,~)
Mobile
Inputs
Mobile Input
scripts.BittyInputBlocks.inputSourceMobile(~)
Touch
scripts.BittyInputBlocks.inputSourceTouch(~,~)
Touch Gesture
scripts.BittyInputBlocks.inputSourceTouchGesture(~)
Device Gesture
scripts.BittyInputBlocks.inputSourceDeviceGesture(~)
Motion Analog
scripts.BittyInputBlocks.inputSourceMotionAnalog(~)
Motion Vector
scripts.BittyInputBlocks.inputSourceMotionVector(~)
Gestures
Set Touch Gesture to
scripts.BittyInputBlocks.setTouchGestureSetting(~,~);
Set Device Gesture to
scripts.BittyInputBlocks.setDeviceGestureSetting(~,~);
Touch
Get Touch Count
scripts.BittyInputBlocks.getTouchCount()
Get Touch for Touch ID
scripts.BittyInputBlocks.getTouchValue(~,~)
Device Motion
Device Motion Value
scripts.BittyInputBlocks.getDeviceMotionValue(~,~)
Orientation Value
scripts.BittyInputBlocks.getOrientationValue(~)
Set Device Motion Threshold
scripts.BittyInputBlocks.setDeviceMotionThreshold(~,~);
Get Device Motion Threshold
scripts.BittyInputBlocks.getDeviceMotionThreshold(~)
Virtual Controls
Inputs
Virtual Input
scripts.BittyInputBlocks.inputSourceVirtual(~)
Virtual Joystick Analog
scripts.BittyInputBlocks.inputSourceVirtualJoystickAnalog(~)
Virtual Joystick Vector
scripts.BittyInputBlocks.inputSourceVirtualJoystickVector(~)
Virtual Buttons
Create Virtual Button at X Y named
scripts.BittyInputBlocks.createVirtualButton(~,~,~);
Register as Virtual Button named
scripts.BittyInputBlocks.registerVirtualButton(~,~);
Set of Virtual Button to
scripts.BittyInputBlocks.setVirtualButtonProperty(~,~,~);
Set Shape of Virtual Button to
scripts.BittyInputBlocks.setVirtualButtonShape(~,~);
Remove Virtual Button
scripts.BittyInputBlocks.removeVirtualButton(~);
Virtual Joysticks
Create Virtual Joystick at X Y Radius named
scripts.BittyInputBlocks.createVirtualJoystick(~,~,~,~,~);
Register as Virtual Joystick named
scripts.BittyInputBlocks.registerVirtualJoystick(~,~,~);
Set of Virtual Joystick to
scripts.BittyInputBlocks.setVirtualJoystickProperty(~,~,~);
Remove Virtual Joystick
scripts.BittyInputBlocks.removeVirtualJoystick(~);
FAQs
Should I read physical inputs directly or use Actions?
Use Actions for normal gameplay. Physical Input Sources should generally be assigned to Actions, so keyboard, controllers, touch gestures, and virtual controls can share the same gameplay logic. Use raw reporters/events when the raw lifecycle or sensor value is itself important.
What is the difference between Pressed, Down, and Released?
Pressed is the frame an input begins. Down stays true while it is held. Released is the frame it ends.
What is the difference between Tap, Long Press, Hold, Drag, Slide, and Swipe?
Tap is a quick mostly stationary release. Long Press is a one-shot event after holding mostly still. Hold is the sustained state that begins at that same long-press point. Drag is sustained movement after crossing Drag Minimum Distance. Slide is a directional one-shot recognized while the finger is still down. Swipe is a fast directional one-shot classified on release. Drag can therefore begin before Slide or Swipe.
Why can Tap fire before Double Tap or Triple Tap?
Tap is intentionally immediate. The first qualifying release emits Tap immediately; later qualifying taps can then emit Double Tap and Triple Tap. This avoids delaying ordinary taps while waiting to see whether another tap arrives.
Can Hold and Drag both be Down at once?
Not for the same touch. If a held touch moves far enough to become a Drag, Hold releases first and Drag becomes Down.
Why does Drag often print before Slide or Swipe?
Drag is a sustained state and can begin as soon as its movement threshold is crossed. Slide needs its own distance plus minimum duration, while Swipe is classified at release. The order is intentional.
Do virtual controls also trigger raw Touch and touch gestures?
No. A virtual control consumes the touch it owns before raw Touch/gesture processing, preventing one finger press from becoming both a virtual-control input and a second gesture/raw input.
What is the difference between Acceleration, Motion, Rotation, Orientation, and Gyro?
Acceleration is the raw accelerometer and includes gravity. Motion is movement acceleration; on Android it uses gravity-free linear acceleration. Orientation is the device’s current Pitch/Roll/Yaw. Rotation is the change in orientation between updates. Gyro is raw angular velocity; on Android it is radians per second.
Does Shake use the Gyro?
No. Shake uses strong alternating linear-Motion reversals. Gyro remains a raw angular-velocity reporter.
Are controller deadzones per controller?
Not yet. Stick and Trigger deadzones are global in this version. The controller-port field is ignored when the selected reporter is Stick Deadzone or Trigger Deadzone.
Release Notes
Version 1.0 — Current documented build
Unified keyboard, mouse, gamepad, touch, mobile-device, gesture, Action Map, Digital Vector, and virtual-control APIs. Includes sustained Hold/Drag, repeatable Pinch/Rotate touch gestures, physical device gestures, Android linear Motion/orientation, and raw Android Gyro reporters.
Documentation generated from the audited extension build represented by the current conversation changes.