Skip to content

Commit

Permalink
Interception only filters subscribed devices
Browse files Browse the repository at this point in the history
  • Loading branch information
evilC committed Oct 28, 2017
1 parent e74d4b6 commit 8033715
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions TestApp/TestApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,10 @@ public Tester()

#region Interception
string keyboardHandle = null;
try { keyboardHandle = inputList["Core_Interception"].Devices.FirstOrDefault().DeviceDescriptor.DeviceHandle; }
catch { return; }
//try { keyboardHandle = inputList["Core_Interception"].Devices.FirstOrDefault().DeviceDescriptor.DeviceHandle; }
//catch { return; }
keyboardHandle = "Keyboard\\HID\\VID_04F2&PID_0112&REV_0103&MI_00";

//keyboardHandle = @"Keyboard\HID\VID_04F2&PID_0112&REV_0103&MI_00";
DeviceDescriptor interceptionKeyboard = new DeviceDescriptor()
{
Expand Down Expand Up @@ -374,14 +376,15 @@ public Tester()
//DeviceHandle = keyboardHandle,
DeviceDescriptor = new DeviceDescriptor()
{
DeviceHandle = mouseHandle,
//DeviceHandle = mouseHandle,
DeviceHandle = keyboardHandle,
},
BindingDescriptor = new BindingDescriptor()
{
Type = BindingType.Button,
//Index = 1, // 1 key on keyboard
Index = 1, // 1 key on keyboard
//Index = 311, // Right ALT key on keyboard
Index = 0, // LMB
//Index = 0, // LMB
},
Callback = new Action<int>((value) =>
{
Expand All @@ -390,7 +393,7 @@ public Tester()
Console.WriteLine("Keyboard Key Value: " + value);
})
};
//iow.SubscribeInput(subInterception);
//ret = iow.SubscribeInput(subInterception);
#endregion

#region Tobii Eye Tracker
Expand Down Expand Up @@ -522,6 +525,12 @@ public Tester()

// Test disposal
//iow.Dispose();
//while (true)
//{
// iow.RefreshDevices("SharpDX_DirectInput");
// iow.SubscribeInput(diButtonSub1);
// Thread.Sleep(100);
//}
}

void ToggleDefaultProfileState()
Expand Down

0 comments on commit 8033715

Please sign in to comment.