Reference to System.Windows.Input


How can I add a reference to such:

Namespace: System.Windows.Input

Assembly: PresentationCore (in PresentationCore.dll)

I can do it in project opened in Visual C#,but Unity resets references during compilation and my code causes error “CS0234: The type or namespace name Windows’ does not exist in the namespace System’. Are you missing an assembly reference?

Unity isn’t using .NET proper. It uses a cross-platform implementation called Mono. As such, a number of Windows-specific namespaces (such as System.Windows.Input) aren’t available. Input in Unity scripting should always be handled via the Input class.

You can copy the dll files from the Mono folder (WindowsBase.dll) and your namespace will work and the methods will be recognised, however, you will receive “Method not implemented” Error a lot.

I wanted to use KeysConverter to simulate Keyboard events. Meh, not happening.