{"id":"nontkph/arclightinput","name":"arclightinput","scope":"nontkph","platform":"roblox","description":"ArcLightInput - Full-stack gameplay input manager with priority blocking, buffering, combos, UI integration, and remap.","version":"1.0.9","latest":"1.0.9","versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.6","1.0.7","1.0.8","1.0.9"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"850aea5b4df0df06345e837e66e31cb9b569972fbe7b4b85160ece41b785777e","likes":0,"downloads":0,"install":"forest install nontkph/arclightinput","url":"https://forest.dev/p/roblox/nontkph/arclightinput","files":"https://api.forest.dev/ai/package/roblox/nontkph/arclightinput/files","readme":"# ArcLight Input\r\n\r\n> A lightweight, priority-based input management system for Roblox\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![Wally](https://img.shields.io/badge/Wally-1.0.6-blue)](https://wally.run/package/nontkph/arclightinput)\r\n\r\n## Features\r\n\r\n- **Priority System** – Manage input conflicts with customizable priority levels\r\n- **Input Buffering** – Capture inputs within configurable time windows\r\n- **Combo Detection** – Detect sequences and combos with the built-in sequence system\r\n- **Multi-Device Support** – Seamless support for keyboard, mouse, gamepad, and touch\r\n- **UI Integration** – Built-in helpers for UI focus and modal states\r\n- **Type-Safe** – Full Luau type definitions included\r\n\r\n## Installation\r\n\r\n### Via Wally (Recommended)\r\n\r\nAdd to your `wally.toml`:\r\n\r\n```toml\r\n[dependencies]\r\narclightinput = \"nontkph/arclightinput@1\"\r\n```\r\n\r\nThen run:\r\n\r\n```bash\r\nwally install\r\n```\r\n\r\n### Manual Installation\r\n\r\n1. Download the latest release from [Releases](https://github.com/nontkph/ArcLight-Input/releases)\r\n2. Place `Core/` and `init.luau` in your project\r\n3. Require the module in your scripts\r\n\r\n## Quick Start\r\n\r\n```lua\r\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\r\nlocal Input = require(ReplicatedStorage.Packages.arclightinput)\r\n\r\n-- Register an action with priority 10\r\nlocal Attack = Input.Register(\"Attack\", 10)\r\n    :Define(Enum.KeyCode.Q)\r\n\r\n-- Listen for the input\r\nAttack.OnBegan:Connect(function()\r\n    player:Attack()\r\nend)\r\n\r\nAttack.OnEnded:Connect(function()\r\n    player:StopAttack()\r\nend)\r\n```\r\n\r\nThat's it. Priority 10 blocks anything below it automatically.\r\n\r\n## Common Patterns\r\n\r\n### Enable Input Buffering\r\n\r\nQueue inputs during animations:\r\n\r\n```lua\r\nAttack:EnableBuffer(0.3) -- 300ms window\r\n```\r\n\r\nBehavior:\r\n- Press during a lock/animation → buffered.\r\n- On key-up, the buffer auto re-fires once the action is unblocked/enabled (no extra calls).\r\n- If you need manual control, call `Attack:ConsumeBuffer()` / `Attack:GetBufferedInput()`.\r\n\r\nReal gameplay flow (auto replay):\r\n\r\n```lua\r\nlocal Attack = Input.Register(\"Attack\", 10)\r\n    :Define(Enum.KeyCode.Q)\r\n    :EnableBuffer(0.35)\r\n\r\n-- Enter an animation lock: disable to block immediate fire\r\nAttack:Disable()\r\ntask.delay(0.2, function()\r\n    Attack:Enable() -- when the player releases Q, the buffered press re-fires automatically\r\nend)\r\n\r\nAttack.OnBegan:Connect(function()\r\n    player:Attack()\r\nend)\r\n\r\nAttack.OnEnded:Connect(function()\r\n    player:StopAttack()\r\nend)\r\n```\r\n\r\nManual control example (only replay when you decide):\r\n\r\n```lua\r\nif Attack:ConsumeBuffer() then\r\n    Attack.OnBegan:Fire() -- optional manual replay hook\r\nend\r\n```\r\n\r\n### Multiple Input Types\r\n\r\n```lua\r\nlocal Attack = Input.Register(\"Attack\", 10)\r\n    :Define(Enum.KeyCode.Q)\r\n    :Define(Enum.UserInputType.Touch)\r\n```\r\n\r\nKeyboard and touch both trigger the same action.\r\n\r\n### Combo / Sequence Detection\r\n\r\n```lua\r\nlocal Ultimate = Input.Register(\"Ultimate\", 9)\r\n    :DefineSequence({\r\n        Enum.KeyCode.Q,\r\n        Enum.KeyCode.W,\r\n        Enum.KeyCode.E\r\n    }, 1.0) -- 1 second window to complete sequence\r\n\r\nUltimate.OnBegan:Connect(function()\r\n    player:executeUltimate()\r\nend)\r\n```\r\n\r\nAutomatically detects the Q-W-E pattern within 1 second.\r\n\r\n### UI Button Binding\r\n\r\n```lua\r\nlocal Shop = Input.Register(\"Shop\", 8)\r\n    :Define(Enum.KeyCode.B)\r\n    :DefineUI(script.Parent.ShopButton)\r\n\r\nShop.OnBegan:Connect(function()\r\n    toggleShop()\r\nend)\r\n```\r\n\r\nOne action handles both keyboard (B key) and the button. Same priority system applies.\r\n\r\n### Runtime Remapping\r\n\r\n```lua\r\n-- In a keybind menu\r\nlocal reader = Input.ReadInput(\"BindAttack\", 1, 5)\r\nreader:Connect(function(input)\r\n    Attack:Remap(input.KeyCode)\r\n    print(\"Attack rebound to\", input.KeyCode)\r\nend)\r\n```\r\n\r\nCaptures the next keypress and rebinds automatically.\r\n\r\n### Critical Priority (Always Works)\r\n\r\n```lua\r\nlocal Menu = Input.Register(\"Menu\", Input.CRITICAL_PRIORITY)\r\n    :Define(Enum.KeyCode.Escape)\r\n\r\nMenu.OnBegan:Connect(function()\r\n    openMenu()\r\nend)\r\n```\r\n\r\nThis action is never blocked, even when other inputs are disabled.\r\n\r\n## API Reference\r\n\r\n### Input (Main Module)\r\n\r\n| Function | Description |\r\n|----------|-------------|\r\n| `Input.Register(name, priority)` | Register a new action, returns Action object |\r\n| `Input.ReadInput(name, maxPresses, timeout)` | Capture next N keypresses within timeout (returns Signal) |\r\n| `Input.GetDevice()` | Get current device type (\"PC\", \"Mobile\", \"GamePad\", \"Console\") |\r\n| `Input.GetTelemetry()` | Get stats: totalInputs, droppedInputs, activeActions |\r\n| `Input.CRITICAL_PRIORITY` | Constant for actions that cannot be blocked |\r\n\r\n### Action (returned from Input.Register)\r\n\r\n| Method | Returns | Description |\r\n|--------|---------|-------------|\r\n| `:Define(input)` | self | Add a keybind (Enum.KeyCode or Enum.UserInputType) |\r\n| `:DefineSequence(inputs, window)` | self | Set up combo/sequence detection with time window |\r\n| `:DefineUI(guiObject)` | self | Bind a UI button to this action |\r\n| `:EnableBuffer(duration)` | self | Queue inputs for X seconds during locks |\r\n| `:Undefine(input)` | self | Remove a keybind |\r\n| `:UndefineUI()` | self | Remove UI binding |\r\n| `:Remap(input)` | self | Change keybind at runtime |\r\n| `:Enable()` | self | Re-enable the action |\r\n| `:Disable()` | - | Disable the action temporarily |\r\n| `:Destroy()` | - | Cleanup and remove the action |\r\n| `.OnBegan` | Signal | Fires when input begins |\r\n| `.OnEnded` | Signal | Fires when input ends |\r\n\r\n## Project Structure\r\n\r\n```\r\nArcLight-Input/\r\n├── Core/\r\n│   ├── ActionRegistry.luau    # Action management\r\n│   ├── BufferSystem.luau      # Input buffering\r\n│   ├── DeviceDetector.luau    # Device detection\r\n│   ├── InputProcessor.luau    # Input normalization\r\n│   ├── SequenceDetector.luau  # Combo/sequence detection\r\n│   ├── Types.luau             # Type definitions\r\n│   └── UIIntegration.luau     # UI helpers\r\n├── init.luau                  # Entry point\r\n├── wally.toml                 # Package manifest\r\n└── README.md\r\n```\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Changelog\r\n\r\nSee [CHANGELOG.md](CHANGELOG.md) for version history.\r\n\r\n---\r\n\r\nMade with ❤️ for the Roblox community\r\n","readmeBorrowedFrom":{"version":"1.0.8","source":"wally"},"readmeTruncated":false}