private void MainForm_Load(object sender, EventArgs e) { var rawDeviceEnumerator = new RawInputDeviceEnumerator(); foreach (var rawInputDevice in rawDeviceEnumerator.Devices.Where( d => d.DeviceType == Win32.RawInputDeviceType.Mouse)) { Console.WriteLine( "{0}:\n\tName = {1}\n\tHandle: = {2}\n", rawInputDevice.DeviceType, rawInputDevice.DeviceName, rawInputDevice.DeviceHandle); } if (File.Exists("offsetX")) { offset.X = int.Parse(File.ReadAllText("offsetX")); offset.Y = int.Parse(File.ReadAllText("offsetY")); } fov = new Fov { Resolution = new Point(1280, 720), FieldOfView = new Rectangle((1280 / 2) - boxSize.X / 2, (720 / 2) - boxSize.Y / 2, boxSize.X, boxSize.Y) }; bot = new Aimbot(new Point(boxSize.X / 2, boxSize.Y / 2)); scanner = new Scanner(); Thread thread = new Thread(CaptureThread); thread.Start(); }
static void Main(string[] args) { var rawDeviceEnumerator = new RawInputDeviceEnumerator(); // enumerates raw input devices of Keyboard type foreach (var rawInputDevice in rawDeviceEnumerator.Devices.Where( d => d.DeviceType == Win32.RawInputDeviceType.Keyboard && d.DeviceInfo.KeyboardInfo.IsUSBKeboard)) { Console.WriteLine( "{0}:\n\tName = {1}\n\tHandle: = {2}\n", rawInputDevice.DeviceType, rawInputDevice.DeviceName, rawInputDevice.DeviceHandle); } Console.WriteLine("Usb Keyboards Count: " + rawDeviceEnumerator.UsbKeyboardsCount); }