public LargeButtonKeyboard() : base()
        {
            InitializeComponent();

            keyboardType = KeyboardType.Lowercase;

            string[,] characters = { { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ABC", "z",  "x", "c", "v", "b", "n", "m", backspace, space, deleteWord, clear },
                                     { "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "A", "S", "D", "F", "G", "H", "J", "K", "L", "123", "Z",  "X", "C", "V", "B", "N", "M", backspace, space, deleteWord, clear },
                                     { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "$", "%", "^", "&", "*", "_", "abc", "\"", ",", ".", "?", ":", ";", "'", backspace, space, deleteWord, clear } };

            keyboard = new ALSKey[characters.GetLength(0), characters.GetLength(1)];

            for (int i = 0; i < keyboard.GetLength(0); i++)
            {
                for (int j = 0; j < keyboard.GetLength(1); j++)
                {
                    keyboard[i, j] = new ALSKey();
                    Controls.Add(keyboard[i, j]);
                    keyboard[i, j].Text    = characters[i, j];
                    keyboard[i, j].btnType = ALSButton.ButtonType.key;

                    switch (keyboard[i, j].Text)
                    {
                    case backspace:
                        keyboard[i, j].Click += Backspace;
                        break;

                    case deleteWord:
                        keyboard[i, j].Click += DeleteWord;
                        break;

                    case clear:
                        keyboard[i, j].Click += Clear;
                        break;

                    case "abc":
                    case "ABC":
                    case "123":
                        keyboard[i, j].Click += NavigateKeyboard;
                        break;

                    default:
                        keyboard[i, j].Click += TypeCharacter;
                        break;
                    }
                }
            }
        }
        public LargeButtonKeyboard()
            : base()
        {
            InitializeComponent();

            keyboardType = KeyboardType.Lowercase;

            string[,] characters = { { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "ABC", "z", "x", "c", "v", "b", "n", "m", backspace, space, deleteWord, clear},
                                 { "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "A", "S", "D", "F", "G", "H", "J", "K", "L", "123", "Z", "X", "C", "V", "B", "N", "M", backspace, space, deleteWord, clear},
                                 { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "$", "%", "^", "&", "*", "_", "abc", "\"", ",", ".", "?", ":", ";", "'", backspace, space, deleteWord, clear} };

            keyboard = new ALSKey[characters.GetLength(0), characters.GetLength(1)];

            for (int i = 0; i < keyboard.GetLength(0); i++)
            {
                for (int j = 0; j < keyboard.GetLength(1); j++)
                {
                    keyboard[i, j] = new ALSKey();
                    Controls.Add(keyboard[i, j]);
                    keyboard[i, j].Text = characters[i, j];
                    keyboard[i, j].btnType = ALSButton.ButtonType.key;

                    switch (keyboard[i, j].Text)
                    {
                        case backspace:
                            keyboard[i, j].Click += Backspace;
                            break;
                        case deleteWord:
                            keyboard[i, j].Click += DeleteWord;
                            break;
                        case clear:
                            keyboard[i, j].Click += Clear;
                            break;
                        case "abc":
                        case "ABC":
                        case "123":
                            keyboard[i, j].Click += NavigateKeyboard;
                            break;
                        default:
                            keyboard[i, j].Click += TypeCharacter;
                            break;
                    }
                }
            }
        }
Esempio n. 3
0
        private void initialConfiguration()
        {
            InitializeComponent();

            keyboardType = KeyboardType.Lowercase;

            string[,] letters = { { lLetters1, lLetters2, lLetters3, "?",      ".",      "ABC", "Space", "Backspace", "Delete Word", "Clear" },
                                  { uLetters1, uLetters2, uLetters3, "?",      ".",      "123", "Space", "Backspace", "Delete Word", "Clear" },
                                  { "0",       "1-9",     symbols1,  symbols2, symbols3, "abc", "Space", "Backspace", "Delete Word", "Clear" },
                                  { "a",       "b",       "c",       "d",      "e",      "f",   "g",     "h",         "i",           "Back"  },
                                  { "j",       "k",       "l",       "m",      "n",      "o",   "p",     "q",         "r",           "Back"  },
                                  { "s",       "t",       "u",       "v",      "w",      "x",   "y",     "z",         "",            "Back"  },
                                  { "A",       "B",       "C",       "D",      "E",      "F",   "G",     "H",         "I",           "Back"  },
                                  { "J",       "K",       "L",       "M",      "N",      "O",   "P",     "Q",         "R",           "Back"  },
                                  { "S",       "T",       "U",       "V",      "W",      "X",   "Y",     "Z",         "",            "Back"  },
                                  { "1",       "2",       "3",       "4",      "5",      "6",   "7",     "8",         "9",           "Back"  },
                                  { ".",       "!",       "?",       ",",      ":",      ";",   "'",     "\"",        "",            "Back"  },
                                  { "@",       "$",       "%",       "^",      "&&",     "*",   "+",     "-",         "=",           "Back"  },
                                  { "(",       ")",       "[",       "]",      "{",      "}",   "|",     "\\",        "/",           "Back"  } };

            keyboard = new ALSKey[letters.GetLength(0), letters.GetLength(1)];

            for (int i = 0; i < keyboard.GetLength(0); i++)
            {
                for (int j = 0; j < keyboard.GetLength(1); j++)
                {
                    keyboard[i, j] = new ALSKey();
                    Controls.Add(keyboard[i, j]);
                    keyboard[i, j].Text    = letters[i, j];
                    keyboard[i, j].btnType = ALSButton.ButtonType.key;

                    switch (i)
                    {
                    case 0:
                    case 1:
                        if (j < 3 || j == 5)
                        {
                            keyboard[i, j].Click += NavigateKeyboard;
                        }
                        else if (j == 3 || j == 4 || j == 6)
                        {
                            keyboard[i, j].Click += TypeCharacter;
                        }
                        else if (j == 7)
                        {
                            keyboard[i, j].Click += Backspace;
                        }
                        else if (j == 8)
                        {
                            if (!browserMode)
                            {
                                keyboard[i, j].Click += DeleteWord;
                            }
                            else
                            {
                                keyboard[i, j].Enabled = false;
                                keyboard[i, j].Visible = false;
                            }
                        }
                        else if (j == 9)
                        {
                            if (!browserMode)
                            {
                                keyboard[i, j].Click += Clear;
                            }
                            else
                            {
                                //keyboard[i, j].Location = keyboard[1, 8].Location; //move clear to delete words position
                            }
                        }
                        break;

                    case 2:
                        if (j == 0)
                        {
                            keyboard[i, j].Click += TypeCharacter;
                        }
                        else if (j >= 1 && j <= 5)
                        {
                            keyboard[i, j].Click += NavigateKeyboard;
                        }
                        else if (j == 6)
                        {
                            keyboard[i, j].Click += TypeCharacter;
                        }
                        else if (j == 7)
                        {
                            keyboard[i, j].Click += Backspace;
                        }
                        else if (j == 8)
                        {
                            if (!browserMode)
                            {
                                keyboard[i, j].Click += DeleteWord;
                            }
                            else
                            {
                                keyboard[i, j].Enabled = false;
                                keyboard[i, j].Visible = false;
                            }
                        }
                        else if (j == 9)
                        {
                            keyboard[i, j].Click += Clear;
                        }
                        break;

                    default:
                        if (j < 9)
                        {
                            keyboard[i, j].Click += TypeCharacter;
                            keyboard[i, j].Click += NavigateKeyboard;
                        }
                        else
                        {
                            keyboard[i, j].Click += NavigateKeyboard;
                        }


                        break;
                    }
                }
            }

            SetIsBrowser(browserMode);
        }
        private void initialConfiguration()
        {
            InitializeComponent();

            keyboardType = KeyboardType.Lowercase;

            string[,] letters = { { lLetters1, lLetters2, lLetters3, "?", ".", "ABC", "Space", "Backspace", "Delete Word", "Clear"},
                                  { uLetters1, uLetters2, uLetters3, "?", ".", "123", "Space", "Backspace", "Delete Word", "Clear"},
                                  { "0", "1-9", symbols1, symbols2, symbols3, "abc", "Space", "Backspace", "Delete Word", "Clear"},
                                  { "a", "b", "c", "d", "e", "f", "g", "h", "i", "Back"},
                                  { "j", "k", "l", "m", "n", "o", "p", "q", "r", "Back"},
                                  { "s", "t", "u", "v", "w", "x", "y", "z", "", "Back"},
                                  { "A", "B", "C", "D", "E", "F", "G", "H", "I", "Back"},
                                  { "J", "K", "L", "M", "N", "O", "P", "Q", "R", "Back"},
                                  { "S", "T", "U", "V", "W", "X", "Y", "Z", "", "Back"},
                                  { "1", "2", "3", "4", "5", "6", "7", "8", "9", "Back"},
                                  { ".", "!", "?", ",", ":", ";", "'", "\"", "", "Back"},
                                  { "@", "$", "%", "^", "&&", "*", "+", "-", "=", "Back"},
                                  { "(", ")", "[", "]", "{", "}", "|", "\\", "/", "Back"} };

            keyboard = new ALSKey[letters.GetLength(0), letters.GetLength(1)];

            for (int i = 0; i < keyboard.GetLength(0); i++)
            {
                for (int j = 0; j < keyboard.GetLength(1); j++)
                {
                    keyboard[i, j] = new ALSKey();
                    Controls.Add(keyboard[i, j]);
                    keyboard[i, j].Text = letters[i, j];
                    keyboard[i, j].btnType = ALSButton.ButtonType.key;

                    switch (i)
                    {
                        case 0:
                        case 1:
                            if (j < 3 || j == 5)
                                keyboard[i, j].Click += NavigateKeyboard;
                            else if (j == 3 || j == 4 || j == 6)
                                keyboard[i, j].Click += TypeCharacter;
                            else if (j == 7)
                                keyboard[i, j].Click += Backspace;
                            else if (j == 8)
                            {
                                if (!browserMode)
                                    keyboard[i, j].Click += DeleteWord;
                                else
                                {
                                    keyboard[i, j].Enabled = false;
                                    keyboard[i, j].Visible = false;

                                }
                            }
                            else if (j == 9)
                            {
                                if (!browserMode)
                                    keyboard[i, j].Click += Clear;
                                else
                                {
                                    //keyboard[i, j].Location = keyboard[1, 8].Location; //move clear to delete words position
                                }
                            }
                            break;
                        case 2:
                            if (j == 0)
                                keyboard[i, j].Click += TypeCharacter;
                            else if (j >= 1 && j <= 5)
                                keyboard[i, j].Click += NavigateKeyboard;
                            else if (j == 6)
                                keyboard[i, j].Click += TypeCharacter;
                            else if (j == 7)
                                keyboard[i, j].Click += Backspace;
                            else if (j == 8)
                            {
                                if (!browserMode)
                                    keyboard[i, j].Click += DeleteWord;
                                else
                                {
                                    keyboard[i, j].Enabled = false;
                                    keyboard[i, j].Visible = false;

                                }
                            }
                            else if (j == 9)
                                keyboard[i, j].Click += Clear;
                            break;
                        default:
                            if (j < 9)
                            {
                                keyboard[i, j].Click += TypeCharacter;
                                keyboard[i, j].Click += NavigateKeyboard;
                            }
                            else
                                keyboard[i, j].Click += NavigateKeyboard;

                            break;
                    }
                }
            }

            SetIsBrowser(browserMode);
        }