Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reference the Windows.Gaming.Input namespace

Tags:

c#

Been looking for the Windows.Gaming.Input namespace but am having a hard time. What should I be referencing to get access to this? MSDN was literally no help in the matter. https://msdn.microsoft.com/en-us/library/windows/apps/windows.gaming.input.aspx

Worth noting that I have already included WindowsBase and System.Windows thinking they may be in there. No luck.

Also tried:

  • c# UWP app
  • c++ DirectX UWP app

Neither would resolve the namespace.

like image 442
Wobbles Avatar asked Apr 18 '16 13:04

Wobbles


1 Answers

Windows.Gaming.Input is a UWP namespace, in order to use it you need to create a UWP app. From your question (you have included WindowsBase and System.Windows) it seems that you've created a WPF app, which is not the case.

You can create a UWP project with New -> Project -> Visual C# -> Windows -> Universal for a C# project and Other Languages -> Visual C++ -> Windows -> Universal for a C++ project.

After that it should work just fine.

enter image description here

like image 91
Eldar Dordzhiev Avatar answered Oct 22 '22 22:10

Eldar Dordzhiev