Best option for exclusive access to keyboard in .NET

Started by
1 comment, last by Adam_42 16 years, 2 months ago
Hello Can someone help me in the right direction with a project I am doing. The application I am creating must be written in .NET 2.0 (or 3.5 when I migrate). I have a windows pc with two keyboards attached to it. One is the default keyboard for doing normal windows stuff. The other is to be used exclusively by my application for controlling the my software. I want the second keyboard to have exclusive control with my application and even when the application loses focus, all keystrokes must still be transmitted to my application. My first thoughts are to use MDX 1.1 as it contains everything I need. It allows me to enumerate all the keyboard devices, allow exclusive access to a particular keyboard and is integrated with .NET. But MDX has long been deprecated and I am uncertain of how it will perform under Vista. SlimDX is another option, but I cannot see any way to enumerate all the keyboard devices (GetDevices). It only allows me to select the default keyboard. The documentation is very slim, so can anyone confirm this? I haven't looked at 'DirectX 8 for Visual Basic Type Library' yet, but I assume it will be less supported than MDX? Can anyone recommend the best option for me? Many thanks Paul
Advertisement
Forgot to mention XNA. Again, I cant see any way to enumerate all the keyboard devices and select a particular one. Is there an option for exclusive and background access aswell?
You'll need to use raw input to read it. See http://blogs.msdn.com/michkap/archive/2005/11/17/492328.aspx for details.

This topic is closed to new replies.

Advertisement