private void UpdateKbControl(KeyboardControlKeys key, UpDownState state)
        {
            int             keyIndex = (int)key;
            KeyboardControl kbc      = kbControlList[keyIndex];

            kbc.State = state;
            kbControlList[keyIndex] = kbc;
        }
 public void UpdateKeyboardControlLastState()
 {
     for (int i = 0; i < kbControlList.Count; i++)
     {
         KeyboardControl kbc = kbControlList[i];
         kbc.LastState    = kbc.State;
         kbControlList[i] = kbc;
     }
 }
        private void SetUpKeyboardControlList()
        {
            int keyIndex            = 0;
            KeyboardControlKeys key = (KeyboardControlKeys)keyIndex;

            do
            {
                KeyboardControl kc = new KeyboardControl();
                kc.Name      = key.ToString();
                kc.Key       = key;
                kc.State     = UpDownState.Up;
                kc.LastState = UpDownState.Up;
                kbControlList.Add(kc);
                keyIndex++;
                key = (KeyboardControlKeys)keyIndex;
            } while (key != KeyboardControlKeys.EndKeyboardControlKey);
        }