Ejemplo n.º 1
0
 public MainWindow()
 {
     InitializeComponent();
     overlayColor.A = 150;
     fillBrush      = new RadialGradientBrush(overlayColor, overlayColor);
     textBrush      = new SolidColorBrush(textColor);
     RenderProfileGrid();
     RenderEventGrid();
     RenderSideGrid();
     _launchPadService.SetButtonPressed(ButtonPressed);
     _launchPadService.SetButtonDown(ButtonDown);
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                //testing repo settings
                launchpadService = new LaunchpadService();
                launchpadService.SetButtonPressed(ButtonPressed);
                launchpadService.SetButtonDown(ButtonDown);
                launchpadService.SetButtonUp(ButtonUp);
                eventService = new EventService();

                SaveTestKeyboardEvent(new KeyboardEvent
                {
                    ButtonX         = 0,
                    ButtonY         = 0,
                    EventName       = "TestKeyboardEvent",
                    ProfileName     = "Profile1",
                    ProfileNumber   = 1,
                    VirtualKeyCodes = new List <VirtualKeyCode> {
                        (VirtualKeyCode)(1 + 48), VirtualKeyCode.VK_K
                    }
                });

                SaveTestProcessEvent(new ProcessEvent
                {
                    ButtonX        = 1,
                    ButtonY        = 0,
                    EventName      = "TestProcessEvent",
                    ProfileName    = "Profile1",
                    ProfileNumber  = 1,
                    ProcessCommand = "notepad",
                });

                Console.WriteLine("Device Name: " + (launchpadService.Device?.DeviceName ?? "Device not found"));
                launchpadService.StartListening();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine("Press any key to close");
                Console.ReadKey();
            }
        }