{"record":{"id":"edfa00388f32a3f6","repo":"stride3d/stride","slug":"the-event-type-evt-gettype-was-not-registered-with-the-input","errorCode":null,"errorMessage":"The event type {evt.GetType()} was not registered with the input manager and cannot be processed","messagePattern":"The event type (.+?) was not registered with the input manager and cannot be processed","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Input/InputManager.cs","lineNumber":452,"sourceCode":"            {\n                source.Update();\n            }\n\n            // Update all input sources so they can send events and update their state\n            foreach (var inputDevice in devices)\n            {\n                inputDevice.Update(events);\n            }\n\n            // Notify PreUpdateInput\n            PreUpdateInput?.Invoke(this, new InputPreUpdateEventArgs { GameTime = gameTime });\n            \n            // Send events to input listeners\n            foreach (var evt in events)\n            {\n                IInputEventRouter router;\n                if (!eventRouters.TryGetValue(evt.GetType(), out router))\n                    throw new InvalidOperationException($\"The event type {evt.GetType()} was not registered with the input manager and cannot be processed\");\n\n                router.RouteEvent(evt);\n            }\n\n            // Update virtual buttons\n            UpdateVirtualButtonStates();\n\n            // Update gestures\n            UpdateGestureEvents(gameTime.Elapsed);\n        }\n\n        /// <summary>\n        /// Registers an object that listens for certain types of events using the specialized versions of <see cref=\"IInputEventListener&lt;\"/>\n        /// </summary>\n        /// <param name=\"listener\">The listener to register</param>\n        public void AddListener(IInputEventListener listener)\n        {\n            foreach (var router in eventRouters)","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Input/InputManager.cs#L434-L470","documentation":"During InputManager.Update, queued input events are dispatched to per-type IInputEventRouter instances. If an event type has no registered router in eventRouters, Stride cannot route it and throws InvalidOperationException, indicating an internal registration inconsistency between the event producer and the manager.","triggerScenarios":"Calling Update when the events queue contains an event type whose router was never registered via the internal eventRouters setup — typically after a custom input source enqueues events without registering its event type.","commonSituations":"Custom IInputSource implementations pushing raw events into the manager; a platform backend producing a new event type unsupported by the current InputManager version.","solutions":["Ensure the input source's event types are registered with the InputManager (use the standard source registration path, Sources.Add).","Update Stride to a version matching your platform backend packages.","Remove or fix custom input sources that enqueue unregistered event types."],"exampleFix":"// before\ncustomSource.Enqueue(new MyCustomInputEvent(...)); // type never registered\n// after\n// use built-in event types or register the router for the custom type\ninputManager.Sources.Add(customSource); // standard registration wires up event routing","handlingStrategy":"try-catch","validationCode":"// ensure sources are registered through InputManager.Sources before enabling updates\nbool ok = input.Sources.Contains(mySource);","typeGuard":null,"tryCatchPattern":"try { input.Update(gameTime); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"was not registered\"))\n{ logger.Error(ex, \"Unregistered input event type; re-adding source\"); input.Sources.Add(mySource); }","preventionTips":["Register custom sources only via the Sources collection.","Keep Stride core and platform input packages on the same version.","Avoid enqueueing raw custom event types into the manager."],"tags":["input","event-routing","invalid-state"],"backgroundTag":"internal-invariant-violation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}