12

I have written a small program in C# 2010 which can split input from different keyboards by making an array of devices using, in part, the following:


--This code works fine for non-unified keyboards--

InputDevice id;
NumberOfKeyboards = id.EnumerateDevices();
id = new InputDevice( Handle );
id.KeyPressed += new InputDevice.DeviceEventHandler( m_KeyPressed );
private void m_KeyPressed( object sender, InputDevice.KeyControlEventArgs e ) {
  lbDescription.Text = e.Keyboard.Name;
  // e.Keyboard.* has many useful strings, none work for me anymore.
}


Very happy with this, I ran out and bought 4 Logitech K230 keyboards which use the Unifying receiver. Sadly, all the keyboard data is now multiplexed and shows up in my code as a single keyboard!

How can I identify which "unified" keyboard the input is coming from? Ideally in C#, but I suppose I am willing to look at other languages if solutions exist.

4

1 回答 1

1

我没有统一键盘,但请检查您是否可以在 Windows 设备中看到多个键盘。然后你可以试试这个http://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard并检查输出。

于 2012-11-14T14:09:38.567 回答