Closed minisbett closed 1 year ago
private static async Task Main() { using (InputDevice inputDevice = InputDevice.GetByIndex(1)) { inputDevice.ErrorOccurred += OnErrorOccured; inputDevice.EventReceived += OnEventReceived; inputDevice.StartEventsListening(); } await Task.Delay(-1); } private static void OnErrorOccured(object? sender, ErrorOccurredEventArgs e) { Console.WriteLine(e.Exception.Message); ; } private static void OnEventReceived(object? sender, MidiEventReceivedEventArgs e) { MidiDevice midiDevice = (MidiDevice) sender!; Console.WriteLine($"Event received from '{midiDevice.Name}' at {DateTime.Now}: {e.Event}"); }
This is my test code, tried just receiving events. On InputDevice.GetAll I got two devices, both my keyboard. Tried both of them, nothing received on any.
This is my test code, tried just receiving events. On InputDevice.GetAll I got two devices, both my keyboard. Tried both of them, nothing received on any.