Ejemplo n.º 1
0
 private void BtnClearToggle_Click(object sender, EventArgs e)
 {
     mRecordDisplayKey       = false;
     mToggleDisplayConfig    = new ToggleDisplayConfiguration();
     lblDisplayShortcut.Text = mToggleDisplayConfig.ToString();
     ToggleDisplayKeyButtons();
 }
Ejemplo n.º 2
0
        private void SettingsForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (mRecordDisplayKey)
            {
                mToggleDisplayConfig = new ToggleDisplayConfiguration();
                mToggleDisplayConfig.ShortcutType = ShortcutType.Keyboard;
                mToggleDisplayConfig.KeyCode      = (int)GetVirtualKey(e.KeyCode);
                btnSetDisplayKey.Text             = "Set New Display Key";
                lblDisplayShortcut.Text           = mToggleDisplayConfig.ToString();
                e.Handled          = true;
                e.SuppressKeyPress = true;
                mRecordDisplayKey  = false;
                ToggleDisplayKeyButtons();
            }
            else
            {
                if (!mScanning)
                {
                    return;
                }

                var config = new PTTConfiguration
                {
                    DeviceType  = PTTDeviceType.Keyboard,
                    ButtonOrKey = (int)GetVirtualKey(e.KeyCode),
                    Name        = "Keyboard"
                };

                if (mIgnoreList.Contains(config))
                {
                    return;
                }

                mNewPttConfiguration = config;
                StopScanning();

                e.Handled          = true;
                e.SuppressKeyPress = true;
            }
        }