Beispiel #1
0
        public void Update()
        {
            if (VirtualComPort.isConnected)
            {
                now = VirtualComPort.GetState();
                if (now.A != last.A || now.S != last.S || now.D != last.D || now.F != last.F)
                {
                    if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.A))
                    {
                        UpdateButtons(buttonEnum.blue);
                    }
                    else if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.S))
                    {
                        UpdateButtons(buttonEnum.red);
                    }
                    else if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.D))
                    {
                        UpdateButtons(buttonEnum.green);
                    }
                    else if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.F))
                    {
                        UpdateButtons(buttonEnum.yellow);
                    }

                    last = now;
                }
            }

            LoadNewElements();
            ChangeList();
        }
Beispiel #2
0
        public void Update()
        {
            if (VirtualComPort.isConnected)
            {
                now = VirtualComPort.GetState();
                if (now.A != last.A || now.S != last.S || now.D != last.D || now.F != last.F)
                {
                    if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.A))
                    {
                        AddButton(buttonEnum.blue, 362.5f);
                    }
                    else if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.S))
                    {
                        AddButton(buttonEnum.red, 462.5f);
                    }
                    else if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.D))
                    {
                        AddButton(buttonEnum.green, 562.5f);
                    }
                    else if (VirtualComPort.keyboardStateSTM.IsKeyDown(Keys.F))
                    {
                        AddButton(buttonEnum.yellow, 662.5f);
                    }
                    ;

                    last = now;
                }
            }
            ReloadElements();
        }