
roblox-input
Player input and cameras across keyboard/mouse, touch, gamepad, VR - Input Action System (InputContext, InputAction, InputBinding), UserInputService (PreferredInput, gameProcessedEvent, mouse lock), ContextActionService, reserved keys, custom cameras with BindToRenderStep. Use when adding controls, keybinds, abilities, vehicles, on-screen buttons, or custom cameras.
- Installs
- 440
- Last 24h
- +22
- Trending rank
- #5398
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/el4cteo/roblox-skills --skill roblox-input- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads roblox-input automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Roblox input and camera
Choose an approach
| Approach | Use when |
|---|---|
Input Action System (InputContext → InputAction → InputBinding) | New gameplay controls. Cross-device bindings configured as instances, contexts you enable/disable, built-in on-screen button binding, prompt display. Recommended. |
UserInputService events | Raw input, text-free hotkeys, mouse position/delta, touch gestures, device detection. |
ContextActionService:BindAction | Legacy/simple bind-with-mobile-button; existing code. |
All input handling is client-side. Send intent to the server via remotes; the server validates.
Input Action System
Structure (typically in ReplicatedStorage.Inputs, or created from a client script):
Inputs (Folder)
PlayContext (InputContext, Priority 1000) -- gameplay controls
Sprint (InputAction, Type = Bool)
Keyboard (InputBinding, KeyCode = LeftShift)
Gamepad (InputBinding, KeyCode = ButtonL3)
Touch (InputBinding, UIButton = <on-screen TextButton>)
MenuContext (InputContext, Priority 2000, Sink = true, Enabled = false)
InputAction.Type:Bool(press/release),Direction1D(triggers, zoom),Direction2D(move, camera),Direction3D(flying),ViewportPosition(pointer position).- Events:
Pressed,Released(Bool only),StateChanged(value)for every type.action:GetState()reads the current value. InputBindingfields:KeyCode; composite directionsUp/Down/Left/Right/Forward/Backward;Scale(e.g.0.01forMouseDelta/TouchDelta);PressedThreshold/ReleasedThresholdfor analog triggers;PrimaryModifier/SecondaryModifierfor chords (Ctrl+S);UIButtonto drive the action from a GUI button;DisplayName/DisplayImagefor prompts.InputContext.Enabledswitches whole control schemes (gameplay ↔ menu ↔ vehicle);Priority+Sinklets a higher context consume keys so lower contexts don't also fire.- Set
Workspace.PlayerScriptsUseInputActionSystem = Enabledto have Roblox's default player/camera scripts use the system too (required for server authority).
--!strict
-- Client: build a Sprint action in code and react to it.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local context = Instance.new("InputContext")
context.Name = "PlayContext"
context.Priority = 1000
local sprint = Instance.new("InputAction")
sprint.Name = "Sprint"
sprint.Type = Enum.InputActionType.Bool
sprint.Parent = context
local keyboard = Instance.new("InputBinding")
keyboard.KeyCode = Enum.KeyCode.LeftShift
keyboard.Parent = sprint
local gamepad = Instance.new("InputBinding")
gamepad.KeyCode = Enum.KeyCode.ButtonL3
gamepad.Parent = sprint
context.Parent = player:WaitForChild("PlayerScripts")
local function setSprinting(on: boolean)
local character = player.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = if on then 24 else 16 -- server should validate/own real speed limits
end
end
sprint.Pressed:Connect(function()
setSprinting(true)
end)
sprint.Released:Connect(function()
setSprinting(false)
end)
Show the right key/button: an InputActionLabel (beta) auto-renders the binding for the current device,
or read action.PreferredBinding (+ its DisplayName/KeyCode) and UserInputService:GetStringForKeyCode
/ GetImageForKeyCode, updating on GetPropertyChangedSignal("PreferredBinding").
UserInputService essentials
--!strict
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input: InputObject, gameProcessedEvent: boolean)
if gameProcessedEvent then
return -- typing in a TextBox, clicking UI, or a core-script action consumed it
end
if input.KeyCode == Enum.KeyCode.E then
print("interact")
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
print("click at", input.Position)
end
end)
local function onPreferredInputChanged()
local preferred = UserInputService.PreferredInput -- KeyboardAndMouse | Touch | Gamepad
print("show prompts for", preferred)
end
UserInputService:GetPropertyChangedSignal("PreferredInput"):Connect(onPreferredInputChanged)
onPreferredInputChanged()
- Always honor
gameProcessedEventor players trigger abilities while typing in chat. PreferredInputreflects what the player is actually using (phone + Bluetooth gamepad →Gamepad); don't branch onTouchEnabled/KeyboardEnabledalone.- Mouse:
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenterfor FPS (set every frame while in first person if other scripts may reset it),GetMouseLocation()(includes top-bar inset),MouseDeltaSensitivity,MouseIconEnabled. - Gamepad:
GetConnectedGamepads,GamepadConnected/Disconnected, thumbstickinput.PositioninInputChanged(apply a dead zone ≈ 0.15). Haptics:HapticService/HapticEffect. - Touch:
TouchTap,TouchLongPress,TouchPinch,TouchSwipe; hide default controls only if you replace them (GuiService.TouchControlsEnabled). - Reserved keys you can't override: Esc/Start (menu), F9 (console), F11, F12, PrintScreen; chat
/, Tab (player list), backpack and tool-number keys unless you disable those core features.
ContextActionService (legacy-compatible)
ContextActionService:BindAction(name, handler, createTouchButton, ...inputs) with handler
(actionName, inputState, inputObject) -> Enum.ContextActionResult?; return Pass to let other
bindings see the input. Use BindActionAtPriority for ordering and UnbindAction when the context
ends (e.g. tool unequipped). Prefer the Input Action System for new work.
Custom cameras
--!strict
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera
local OFFSET = Vector3.new(0, 30, 20)
camera.CameraType = Enum.CameraType.Scriptable
RunService:BindToRenderStep("TopDownCamera", Enum.RenderPriority.Camera.Value + 1, function()
local character = Players.LocalPlayer.Character
local root = character and character:FindFirstChild("HumanoidRootPart") :: BasePart?
if root then
local target = root.Position
camera.CFrame = CFrame.lookAt(target + OFFSET, target)
end
end)
-- Restore: RunService:UnbindFromRenderStep("TopDownCamera"); camera.CameraType = Enum.CameraType.Custom
- Update cameras in
BindToRenderStep(runs before render, ordered), notHeartbeat/task.waitloops. - Smooth with
camera.CFrame:Lerp(goal, 1 - math.exp(-speed * deltaTime))(frame-rate independent). - First person:
player.CameraMode = Enum.CameraMode.LockFirstPerson; zoom limits withplayer.CameraMinZoomDistance/CameraMaxZoomDistance. Shake: offset the CFrame, don't move parts. - Screen → world:
camera:ViewportPointToRay(x, y)/ScreenPointToRay+workspace:Raycast.
Cross-platform checklist
- Every action has keyboard, gamepad, and touch bindings (touch via
UIButtonor on-screen buttons). - Prompts/hints update when
PreferredInputchanges. Console UI is navigable with D-pad and closes with B. - No hover-only interactions (touch has no hover). Hold-to-confirm for destructive actions.
- Test in Studio's Device Simulator (touch hints included) and Controller Emulator.
Related skills
roblox-ui (buttons, gamepad selection), roblox-characters-animation (movement, abilities),
roblox-networking (sending intents), roblox-physics (vehicles).
FAQ
What does the roblox-input skill do?
Player input and cameras across keyboard/mouse, touch, gamepad, VR - Input Action System (InputContext, InputAction, InputBinding), UserInputService (PreferredInput, gameProcessedEvent, mouse lock), ContextActionService, reserved keys, custom cameras with BindToRenderStep. Use when adding controls, keybinds, abilities, vehicles, on-screen buttons, or custom cameras.
How do I install roblox-input?
Run npx skills add https://github.com/el4cteo/roblox-skills --skill roblox-input in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/roblox-input/ (personal) or .claude/skills/roblox-input/ (project).
Which AI agents can use roblox-input?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is roblox-input safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains roblox-input?
It is published by el4cteo in el4cteo/roblox-skills. It has 440 recorded installs.
More from el4cteo/roblox-skills
roblox-world-building
el4cteo/roblox-skills
Building worlds with code - parts, models and pivots, materials, Lighting (LightingStyle, Atmosphere, post-processing), day/night, Terrain API, in-game CSG and destruction (GeometryService Subtract/Union/Fragment), ProceduralModel, EditableMesh/EditableImage, particles/beams/trails/highlights. Use when creating maps, environments, lighting, destructible objects, procedural levels, or visual effects.
roblox-ui
el4cteo/roblox-skills
Responsive cross-platform UI - ScreenGui and safe areas (ScreenInsets), Scale vs Offset, UIListLayout flex/UIFlexItem, constraints, StyleSheets/tokens/themes, RichText, gamepad/touch navigation, UIDragDetector, CanvasGroup, tweens, BillboardGui/SurfaceGui, React-lua/Fusion/Vide. Use when building HUDs, menus, shops, inventories, or fixing UI that breaks on mobile, console, or other screen sizes.
roblox-testing
el4cteo/roblox-skills
Open the skill to read its SKILL.md instructions.
roblox-performance
el4cteo/roblox-skills
Open the skill to read its SKILL.md instructions.
roblox-code-review
el4cteo/roblox-skills
Review Roblox/Luau code for exploits, data loss, memory leaks, performance problems, lifecycle bugs, policy issues, and deprecated or superseded APIs, using a severity-ranked checklist and the full 2026 deprecation map. Use when reviewing a PR or script, auditing a game before launch, modernizing legacy code, or asked what is wrong with some Roblox code.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.