static void Main(string[] args) { LogiDevMon.GetDevices(ListDevices); Thread.Sleep(1500); Console.WriteLine(); if (LogiDevMon.devices.Count > 0 && keyboardIndex != -1) { Console.WriteLine("SpyConfig for: " + LogiDevMon.devices[keyboardIndex].name); LogiDevMon.GetSpyConfig(LogiDevMon.devices[keyboardIndex].unitId, ShowSpyConfig); Thread.Sleep(1000); SpyConfig spyconfig = new SpyConfig { unitId = LogiDevMon.devices[keyboardIndex].unitId, spyKeys = true }; Console.WriteLine("\nSpy keyboard keys"); LogiDevMon.SetSpyConfig(spyconfig); Thread.Sleep(1000); LogiDevMon.GetSpyConfig(LogiDevMon.devices[keyboardIndex].unitId, ShowSpyConfig); Thread.Sleep(1000); Console.WriteLine("\nRead Key events"); LogiDevMon.ReadEvents(ShowEvents); } else { Console.WriteLine("No keyboard detected, press any key to exit..."); } Console.ReadKey(true); }
static void Main(string[] args) { LogiDevMon.GetDevices(ListDevices); Thread.Sleep(1500); Console.WriteLine(); if (LogiDevMon.devices.Count > 0 && keyboardIndex != -1) { //Console.WriteLine("SpyConfig for: " + LogiDevMon.devices[keyboardIndex].name); //LogiDevMon.GetSpyConfig(LogiDevMon.devices[keyboardIndex].unitId, ShowSpyConfig); //Thread.Sleep(1000); //SpyConfig spyconfig = new SpyConfig //{ // unitId = LogiDevMon.devices[keyboardIndex].unitId, // spyKeys = true //}; //Console.WriteLine("\nSpy keyboard keys"); //LogiDevMon.SetSpyConfig(spyconfig); //Thread.Sleep(1000); //LogiDevMon.GetSpyConfig(LogiDevMon.devices[keyboardIndex].unitId, ShowSpyConfig); //Thread.Sleep(1000); ////////////////////////////////////////////////////////////////////////////////////77 //LogiDevMon.GetSpecialKeys(LogiDevMon.devices[keyboardIndex].unitId, ListSpecialKeys); //Thread.Sleep(2500); ////////////////////////////////////////////////////////////////////////////////////77 SpecialKey F1 = new SpecialKey { unitId = LogiDevMon.devices[0].unitId, controlId = 199, //F1 divert = true, persist = true }; SpecialKey F2 = new SpecialKey { unitId = LogiDevMon.devices[0].unitId, controlId = 200, //F2 divert = true, persist = true }; SpecialKey F3 = new SpecialKey { unitId = LogiDevMon.devices[0].unitId, controlId = 224, //F3 divert = true, persist = true }; SpecialKey F4 = new SpecialKey { unitId = LogiDevMon.devices[0].unitId, controlId = 225, //F4 divert = true, persist = true }; SpecialKey F5 = new SpecialKey { unitId = LogiDevMon.devices[0].unitId, controlId = 110, //F5 divert = true, persist = true }; LogiDevMon.SetSpecialKey(F1); LogiDevMon.SetSpecialKey(F2); LogiDevMon.SetSpecialKey(F3); LogiDevMon.SetSpecialKey(F4); LogiDevMon.SetSpecialKey(F5); Console.WriteLine("\nRead Key events"); LogiDevMon.ReadEvents(ShowEvents); } else { Console.WriteLine("No keyboard detected, press any key to exit..."); } Console.ReadKey(true); }