private void KeyPressedEvent(LaunchEvent launchEvent) { LaunchAction action = LaunchPageHandler.Instance().CurPage.GetAction(launchEvent.Key); if (action != null) { if (launchEvent.IsPressed()) { action.Press(); } else { action.Release(); } } }
public LaunchpadController() { Instance = this; InitScreen(); FindPad(); if (Output == null || Input == null) { MessageBox.Show("Unable to find MIDI input or MIDI output!", "Error", MessageBoxButtons.OK); return; } Log.Debug("Located input and output of Launchpad MIDI"); if (OpenConnection()) { MidiMessageHandler.Instance().Init(Input, Output); LaunchPageHandler.Instance().CreatePages(); Log.Info("Everything is set up and working!"); } Application.Run(Screen); }