public void ReleaseKey(AbstractWindowsEnvironment.VirtualKeyShort key) { EnsureNotCanceled(); int kcpIdx = this.keysCurrentlyPressed.IndexOf(key); if (kcpIdx >= 0) { this.environmentInterface.ReleaseKey(key); this.keysCurrentlyPressed.RemoveAt(kcpIdx); } }
public void PressKey(AbstractWindowsEnvironment.VirtualKeyShort key) { EnsureNotCanceled(); // Check if the window is still active and in foreground. GetMainWindowPosition(); if (!this.keysCurrentlyPressed.Contains(key)) { this.environmentInterface.PressKey(key); this.keysCurrentlyPressed.Add(key); } }
public PressKeyAction(AbstractWindowsEnvironment.VirtualKeyShort key, int duration) { this.key = key; this.duration = duration; }