private void button1_Click(object sender, EventArgs e) { inputdevices = new InputDeviceList((s) => { BeginInvoke(s); }); inputdevices.OnNewEvent += Inputdevices_OnNewEvent; DirectInputDevices.InputDeviceJoystickWindows.CreateJoysticks(inputdevices, true); DirectInputDevices.InputDeviceKeyboard.CreateKeyboard(inputdevices); // Created.. not started.. DirectInputDevices.InputDeviceMouse.CreateMouse(inputdevices); foreach (var id in inputdevices) { Print("Device " + id.ToString()); Print("Buttons: " + string.Join(",", id.EventButtonNames())); } inputdevices.Start(); }
public void Start() { devices.OnNewEvent += Devices_OnNewEvent; devices.Start(); }