Beispiel #1
0
        // Fires when a key has been pressed, used in conjunction with keyboard controls
        private void MyKeyDown(object sender, KeyEventArgs e)
        {
            if (Settings.RequireNumLock)
            {
                if (!Win32.NumLock())
                {
                    return;
                }
            }

            if (Settings.RequireCapsLock)
            {
                if (!Win32.CapsLock())
                {
                    return;
                }
            }

            if (Settings.UseKeyboardControls)
            {
                string keyCode = GetKeyCode(e);

                // Do we have an active table?
                if (pokerTables.ContainsKey(activeTable))
                {
                    PokerTable table = (PokerTable)pokerTables[activeTable];

                    switch (keyCode)
                    {
                    case "back":
                        string txt = table.GetRaiseValue();

                        if (txt.Length > 0)
                        {
                            table.SetRaiseValue(txt.Substring(0, txt.Length - 1));
                        }
                        break;

                    case "0":
                        table.SetRaiseValue(table.GetRaiseValue() + "0");
                        break;

                    case "1":
                        table.SetRaiseValue(table.GetRaiseValue() + "1");
                        break;

                    case "2":
                        table.SetRaiseValue(table.GetRaiseValue() + "2");
                        break;

                    case "3":
                        table.SetRaiseValue(table.GetRaiseValue() + "3");
                        break;

                    case "4":
                        table.SetRaiseValue(table.GetRaiseValue() + "4");
                        break;

                    case "5":
                        table.SetRaiseValue(table.GetRaiseValue() + "5");
                        break;

                    case "6":
                        table.SetRaiseValue(table.GetRaiseValue() + "6");
                        break;

                    case "7":
                        table.SetRaiseValue(table.GetRaiseValue() + "7");
                        break;

                    case "8":
                        table.SetRaiseValue(table.GetRaiseValue() + "8");
                        break;

                    case "9":
                        table.SetRaiseValue(table.GetRaiseValue() + "9");
                        break;

                    case ".":
                        table.SetRaiseValue(table.GetRaiseValue() + ".");
                        break;
                    }

                    // Check / call
                    if (keyCode == Settings.CheckCallKeyCode)
                    {
                        table.CheckCall();
                    }

                    // Bet / raise
                    if (keyCode == Settings.BetRaiseKeyCode)
                    {
                        table.BetRaise();
                    }

                    // Fold
                    if (keyCode == Settings.FoldKeyCode)
                    {
                        table.Fold();
                    }

                    // Auto push
                    if (keyCode == Settings.AutoPushKeyCode)
                    {
                        table.AutoPush();
                    }

                    // Move cursor to active table
                    if (keyCode == Settings.MoveCursorToActiveTableKeyCode)
                    {
                        table.MoveCursorToTable();
                    }
                }

                // Generic keyboard control functions
                // Rearrange tables
                if (keyCode == Settings.RearrangeTablesKeyCode)
                {
                    rearrangeTables();
                }

                // Toggle force table to top
                if (keyCode == Settings.ForceActiveTableTopmostKeyCode)
                {
                    Settings.ForceActiveTableToBeTopmost = !Settings.ForceActiveTableToBeTopmost;
                }

                // Toggle lobby opened/minimized
                if (keyCode == Settings.ToggleLobbyKeyCode)
                {
                    if (Settings.KeepLobbyMinimized || (!Settings.KeepLobbyOpened))
                    {
                        Settings.KeepLobbyMinimized = false;
                        Settings.KeepLobbyOpened    = true;
                    }
                    else if (Settings.KeepLobbyOpened)
                    {
                        Settings.KeepLobbyMinimized = true;
                        Settings.KeepLobbyOpened    = false;
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Fires when a voice command has been received
        /// </summary>
        /// <param name="StreamNumber"></param>
        /// <param name="StreamPosition"></param>
        /// <param name="RecognitionType"></param>
        /// <param name="Result"></param>
        private void commandReceived(string command)
        {
            if (Settings.RequireNumLock)
            {
                if (!Win32.NumLock())
                {
                    return;
                }
            }

            if (Settings.RequireCapsLock)
            {
                if (!Win32.CapsLock())
                {
                    return;
                }
            }

            // Do we have an active table?
            if (pokerTables.ContainsKey(activeTable))
            {
                PokerTable table = pokerTables[activeTable];

                if (Settings.UseVoiceCommands)
                {
                    switch (command)
                    {
                    case "Bet":
                    case "Raise":
                        table.BetRaise();
                        break;

                    case "Call":
                    case "Check":
                        table.CheckCall();
                        break;

                    case "Fold":
                        table.Fold();
                        break;

                    case "Zero":
                        table.SetRaiseValue(table.GetRaiseValue() + "0");
                        break;

                    case "One":
                        table.SetRaiseValue(table.GetRaiseValue() + "1");
                        break;

                    case "Two":
                        table.SetRaiseValue(table.GetRaiseValue() + "2");
                        break;

                    case "Three":
                        table.SetRaiseValue(table.GetRaiseValue() + "3");
                        break;

                    case "Four":
                        table.SetRaiseValue(table.GetRaiseValue() + "4");
                        break;

                    case "Five":
                        table.SetRaiseValue(table.GetRaiseValue() + "5");
                        break;

                    case "Six":
                        table.SetRaiseValue(table.GetRaiseValue() + "6");
                        break;

                    case "Seven":
                        table.SetRaiseValue(table.GetRaiseValue() + "7");
                        break;

                    case "Eight":
                        table.SetRaiseValue(table.GetRaiseValue() + "8");
                        break;

                    case "Nine":
                        table.SetRaiseValue(table.GetRaiseValue() + "9");
                        break;

                    case "Ten":
                        table.SetRaiseValue(table.GetRaiseValue() + "10");
                        break;

                    case "Twenty":
                        table.SetRaiseValue(table.GetRaiseValue() + "20");
                        break;

                    case "Thirty":
                        table.SetRaiseValue(table.GetRaiseValue() + "30");
                        break;

                    case "Fourty":
                        table.SetRaiseValue(table.GetRaiseValue() + "40");
                        break;

                    case "Fifty":
                        table.SetRaiseValue(table.GetRaiseValue() + "50");
                        break;

                    case "Sixty":
                        table.SetRaiseValue(table.GetRaiseValue() + "60");
                        break;

                    case "Seventy":
                        table.SetRaiseValue(table.GetRaiseValue() + "70");
                        break;

                    case "Eighty":
                        table.SetRaiseValue(table.GetRaiseValue() + "80");
                        break;

                    case "Ninety":
                        table.SetRaiseValue(table.GetRaiseValue() + "90");
                        break;

                    case "Hundred":
                        table.SetRaiseValue(table.GetRaiseValue() + "00");
                        break;

                    case "Thousand":
                        table.SetRaiseValue(table.GetRaiseValue() + "000");
                        break;

                    case "Point":
                        table.SetRaiseValue(table.GetRaiseValue() + ".");
                        break;

                    case "Clear":
                        table.SetRaiseValue("");
                        break;

                    case "Eleven":
                        table.SetRaiseValue(table.GetRaiseValue() + "11");
                        break;

                    case "Twelve":
                        table.SetRaiseValue(table.GetRaiseValue() + "12");
                        break;

                    case "Thirteen":
                        table.SetRaiseValue(table.GetRaiseValue() + "13");
                        break;

                    case "Fourteen":
                        table.SetRaiseValue(table.GetRaiseValue() + "14");
                        break;

                    case "Fifteen":
                        table.SetRaiseValue(table.GetRaiseValue() + "15");
                        break;

                    case "Sixteen":
                        table.SetRaiseValue(table.GetRaiseValue() + "16");
                        break;

                    case "Seventeen":
                        table.SetRaiseValue(table.GetRaiseValue() + "17");
                        break;

                    case "Eighteen":
                        table.SetRaiseValue(table.GetRaiseValue() + "18");
                        break;

                    case "Nineteen":
                        table.SetRaiseValue(table.GetRaiseValue() + "19");
                        break;

                    case "Push":
                        table.AutoPush();
                        break;
                    }

                    // Presets
                    if (command == Settings.VCPreset1)
                    {
                        table.SetRaiseValue(Settings.VCPreset1Amount);
                        return;
                    }
                    if (command == Settings.VCPreset2)
                    {
                        table.SetRaiseValue(Settings.VCPreset2Amount);
                        return;
                    }
                    if (command == Settings.VCPreset3)
                    {
                        table.SetRaiseValue(Settings.VCPreset3Amount);
                        return;
                    }
                }
            }
        }