{"id":13708350,"url":"https://github.com/rsptim1/Ctrl","last_synced_at":"2025-05-06T12:31:49.797Z","repository":{"id":140304004,"uuid":"287813048","full_name":"rsptim1/Ctrl","owner":"rsptim1","description":"Input system wrapper built on Stride's native input system","archived":false,"fork":false,"pushed_at":"2020-10-30T00:24:00.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-13T18:43:30.560Z","etag":null,"topics":["csharp","stride3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsptim1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-15T19:37:07.000Z","updated_at":"2022-09-03T20:26:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5932ee8-d8d2-4c6a-b5a6-840881153776","html_url":"https://github.com/rsptim1/Ctrl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsptim1%2FCtrl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsptim1%2FCtrl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsptim1%2FCtrl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsptim1%2FCtrl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsptim1","download_url":"https://codeload.github.com/rsptim1/Ctrl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252683539,"owners_count":21788061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","stride3d"],"created_at":"2024-08-02T23:00:20.976Z","updated_at":"2025-05-06T12:31:49.791Z","avatar_url":"https://github.com/rsptim1.png","language":"C#","funding_links":[],"categories":["Example Projects"],"sub_categories":[],"readme":"# Ctrl\n*Ctrl* is a programmer-oriented wrapper for Stride's native input system. The goal is to make grabbing player inputs at runtime more standardized and configurable, and to allow easy rebinding of controls.\n\n## Roadmap:\n\n- [x] Basic binding controls for buttons and axes\n- [ ] Advanced mouse controls and utilities\n- [ ] Easy runtime rebinding\n- [ ] Savable and loadable controller binding layouts\n\n# Using Ctrl\n\nThe most configurable way to utilize *Ctrl* is by implementing the `PlayerActionSet` class and having `PlayerAction` fields to be read from.\n\n```cs\npublic class InputController : PlayerActionSet\n{\n    private readonly TwoAxisPlayerAction exampleAxis;\n    public TwoPlayerAxisAction =\u003e ExampleAxis;\n\n    private readonly PlayerAction exampleButton;\n    public PlayerAction =\u003e ExampleButton;\n\n    public InputController() : base()\n    {\n        // Setup the axis action\n        // Note: each PlayerAction must be assigned a unique name\n        exampleAxis = CreateTwoAxisPlayerAction(\"Axis\");\n        exampleAxis.AddBinding(MouseAxis.X, MouseAxis.Y);\n\n        // Setup the button action\n        exampleAxis = CreatePlayerAction(\"Button\");\n        exampleAxis.AddBinding(Keys.Space);\n    }\n}\n```\n\nThese player actions can now be read for input values.\n\n```cs\nvar controller = new InputController();\n\nbool isPressed = controller.ExampleButton.IsPressed;\nVector2 axisInput = controller.ExampleAxis.Vector;\n```\n\n\u003csup\u003e\u003csub\u003eYes, the name is a pun.\u003c/sub\u003e\u003c/sup\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsptim1%2FCtrl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsptim1%2FCtrl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsptim1%2FCtrl/lists"}