Beispiel #1
0
        private void GetKeyboardData()
        {
            // InstalledKeyboards contains the list of keyboard names and locales
            // Combo just gets the names at that's what combos like.

            ArrayList keyboardComboData;

            ToolStripItem[] keyboardMenuData;

            var tempArr = new ArrayList(KeyboardHelper.InstalledKeyboards.Keys);

            tempArr.Sort();
            keyboardComboData = new ArrayList(KeyboardHelper.InstalledKeyboards.Count + 1);
            // Add the current keyboard and a separator:
            keyboardComboData.Add(new ComboItemSeparator.SeparatorItem(KeyboardHelper.GetKeyboardName()));
            keyboardComboData.AddRange(tempArr);

            KeyboardListCombo.DataSource = keyboardComboData;

            keyboardMenuData = new ToolStripMenuItem[KeyboardHelper.InstalledKeyboards.Count];

            int count = 0;

            foreach (string name in tempArr)
            {
                keyboardMenuData[count] = new ToolStripMenuItem(name, null, selectLayoutToolStripItemClick);
                count++;
            }

            selectLayoutToolStripMenuItem.DropDownItems.AddRange(keyboardMenuData);
        }
Beispiel #2
0
 private void revertToDefaultKeyboardLayoutMenuItemClick(object sender, EventArgs e)
 {
     // Revert to default keyboard layout
     ChangeKeyboard(KeyboardHelper.GetKeyboardName());
     Redraw();
 }