Example #1
0
 protected internal KeyDownEventArgs(KeyEventConfiguration keycfg)
 {
     KeyConfig = keycfg;
     IsShift = Keyboard.Keyboard.GetAsyncKeyState(Keys.ShiftKey);
     IsAlt = Keyboard.Keyboard.GetAsyncKeyState(Keys.Menu);
     IsCtrl = Keyboard.Keyboard.GetAsyncKeyState(Keys.LControlKey) || Keyboard.Keyboard.GetAsyncKeyState(Keys.RControlKey);
 }
Example #2
0
        public static void StartMonitoringKey(KeyEventConfiguration key)
        {
            for (int i = 0; i < keyConfigs.Count; i++)
            {
                // if the current Keys value is being monitored...
                if (keyConfigs[i].Key == key.Key)
                {
                    keyConfigs[i] = key;
                    return;
                }
            }

            // if code gets here, Keys value not being monitored yet
            keyConfigs.Add(key);
        }
Example #3
0
 public static void SetTimeBetweenEvents(KeyEventConfiguration key, double timeBetweenEvents)
 {
     StartMonitoringKey(key);
     SetTimeBetweenEvents(key.Key, timeBetweenEvents);
 }
Example #4
0
 public static void SetKeyEventPause(KeyEventConfiguration key, bool paused)
 {
     StartMonitoringKey(key);
     SetKeyEventPause(key.Key, paused);
 }