Пример #1
0
        private void registerButton_Click(object sender, EventArgs e)
        {
            if (bHotKeyRegistered)
            {
                bHotKeyRegistered     = !voipclient.UnregisterHotKey(PUSH_TO_TALK_ID);
                registerButton.Text   = "Register hotkey";
                ctrlCheckBox.Checked  = false;
                altCheckBox.Checked   = false;
                shiftCheckBox.Checked = false;
                winCheckBox.Checked   = false;
                vkTextBox.Text        = "";
            }
            else
            {
                if (vkTextBox.Text.Length == 1)
                {
                    voipclient.UnregisterHotKey(PUSH_TO_TALK_ID);
//                    int iASCII = Convert.ToInt32( vkTextBox.Text.ToCharArray().GetValue(0) );
                    char cKey = (char)vkTextBox.Text.ToCharArray().GetValue(0);
                    bHotKeyRegistered = voipclient.RegisterHotKey(
                        PUSH_TO_TALK_ID,
                        ctrlCheckBox.Checked,
                        altCheckBox.Checked,
                        shiftCheckBox.Checked,
                        winCheckBox.Checked,
                        //                        0 );
                        //                        iASCII );
                        cKey);
                    registerButton.Text = "Clear hotkey";
                }
                else
                {
                    MessageBox.Show("Please enter a virtual key");
                }
            }
        }
Пример #2
0
 public void SetPushToTalk(bool val)
 {
     m_pushToTalk = val;
     if (val && Talk)
     {
         // Register push-to-talk key
         bHotKeyRegistered = m_voipclient.RegisterHotKey(
             kiPUSH_TO_TALK_ID,
             false,  // control
             false,  // alt
             false,  // shift
             false,  // windows key
             kcPushToTalkKey);
     }
     else
     {
         // UnRegister push-to-talk key
         m_voipclient.UnregisterHotKey(kiPUSH_TO_TALK_ID);
         bHotKeyRegistered = false;
     }
 }