@tabooharmony/roblox-input

Use when handling Roblox keyboard, mouse, gamepad, touch, motion input, or cross-platform action binding.

View in AI SkillSafe app
0 downloads
0 stars
0 demos
SKILL.md
nameroblox-input
descriptionUse when handling Roblox keyboard, mouse, gamepad, touch, motion input, or cross-platform action binding.
last_reviewed2026-09-05
sourceshttps://devforum.roblox.com/t/the-correct-way-to-design-mobile-buttons/2494558, https://create.roblox.com/docs/reference/engine/classes/UserInputService, https://create.roblox.com/docs/projects/server-authority, https://create.roblox.com/docs/ui/3D-drag-detectors, https://create.roblox.com/docs/ui/ui-drag-detectors

Roblox Input

When to Load

Load for keyboard, mouse, gamepad, touch, motion, or cross-platform action binding. Client-side only. For simulation-affecting input in a Server Authority project, use the Input Action System rather than traditional input events.

Quick Reference

Core events (UserInputService): InputBegan, InputChanged, InputEnded fire as (input: InputObject, gameProcessedEvent: boolean). InputBegan does NOT fire for mouse wheel. Events only fire while the client window is focused.

Prefer ContextActionService over InputBegan for gameplay: free conflict resolution (chat won't steal H) and free mobile buttons:

local CAS = game:GetService("ContextActionService")

local function onAction(name, state, _input)
    if name == "Jump" and state == Enum.UserInputState.Begin then
        humanoid.Jump = true
    end
end

CAS:BindAction("Jump", onAction, true,
    Enum.KeyCode.Space, Enum.KeyCode.ButtonA)

BindAction(name, handler, createTouchButton, ...inputTypes). Handler returns ContextActionResult.Sink to consume, .Pass to fall through.

Server Authority: use InputAction/InputContext for inputs that affect the core simulation, store the input state where the synchronized simulation can read it, and process it through RunService:BindToSimulation() (requires Workspace.UseFixedSimulation enabled in Studio). ContextActionService remains appropriate for UI-only or classic-project actions.

Gamepad UI focus: separate gameplay bindings from menu selection. Set GuiService.SelectedObject, mark controls Selectable, and test nested/modal navigation.

Gamepad: use GetConnectedGamepads() and listen to connection changes.

Touch: use high-level gesture events or raw TouchStarted/TouchMoved/TouchEnded when tracking fingers.

Dragging: DragDetector (3D parts/models, physics-capable) and UIDragDetector (UI) make objects draggable with zero code; events DragStart/DragContinue/DragEnd.

Pitfalls:

  • gameProcessedEvent=true in InputBegan → UI consumed it. Filter for gameplay.
  • BindAction is stack-based: most-recent wins. Use BindActionAtPriority.
  • Client-only. Server scripts silently no-op.
  • JumpRequest fires multiple times per jump; debounce.
  • Mouse wheel only fires InputChanged.

Full event tables and polling methods: references/full.md.

Embed badges

Add these to your README to show the skill's verification status.

SkillSafe verified badge
Verified badge
[![SkillSafe verified badge](https://api.skillsafe.ai/v1/badge/@tabooharmony/roblox-input/verified)](https://skillsafe.ai/skill/@tabooharmony/roblox-input/)
Installs badge
Installs badge
[![Installs badge](https://api.skillsafe.ai/v1/badge/@tabooharmony/roblox-input/installs)](https://skillsafe.ai/skill/@tabooharmony/roblox-input/)
Scan badge
Scan badge
[![Scan badge](https://api.skillsafe.ai/v1/badge/@tabooharmony/roblox-input/scan)](https://skillsafe.ai/skill/@tabooharmony/roblox-input/)
Eval pass rate badge
Eval pass rate
[![Eval pass rate badge](https://api.skillsafe.ai/v1/badge/@tabooharmony/roblox-input/eval)](https://skillsafe.ai/skill/@tabooharmony/roblox-input/)