سؤال

I've recently swapped from MDX 2.0 to SlimDX, using Direct3D 11, but I'm struggling to implement keyboard and mouse controls.

In MDX you can use

keyb = new Microsoft.DirectX.DirectInput.Device(SystemGuid.Keyboard);
keyb.SetCooperativeLevel(this, CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive);
keyb.Acquire();

to set up a keyboard interface, however SlimDX has a different method. In SlimDX the Device is an abstract class, instead there is a Keyboard class that must be initialized by passing in a DirectInput object, but I can't for the life of me work out how to create a DirectInput object or what it's for.

As far as I can find documentation is pretty slim for SlimDX, if anybody knows of any good resources for learning its particular quirks that would be fantastic, thanks.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top