コード例 #1
0
        public static void ComboUp(DirectKeyCombo combo)
        {
            var kc = new List <DirectKeycode>();

            if (combo.CtrlKey && combo.Left)
            {
                kc.Add(DirectKeycode.DkcLcontrol);
            }
            else
            {
                kc.Add(DirectKeycode.DkcRcontrol);
            }

            if (combo.ShiftKey && combo.Left)
            {
                kc.Add(DirectKeycode.DkcLshift);
            }
            else
            {
                kc.Add(DirectKeycode.DkcRshift);
            }

            if (combo.AltKey && combo.Left)
            {
                kc.Add(DirectKeycode.DkcLmenu);
            }
            else
            {
                kc.Add(DirectKeycode.DkcRmenu);
            }

            kc.AddRange(combo.DirectKeycodes);

            foreach (var key in kc)
            {
                KeyUp(key);
            }
        }
コード例 #2
0
 public static void ComboPress(DirectKeyCombo combo, uint duration)
 {
     ComboDown(combo);
     Thread.Sleep((int)duration);
     ComboDown(combo);
 }