public RouteHandler_MouseClick( ILogger log, IMouseSimulator mouseSimulator ) : base(log) { this.mouseSimulator = mouseSimulator; }
public ControllerAsInput() { _controller = new Controller(UserIndex.One); _mouseSimulator = new InputSimulator().Mouse; _keyboardSimulator = new InputSimulator().Keyboard; _timer = new Timer(obj => Update()); }
/// <summary> /// Initializes a new instance of the <see cref="InputSimulator" /> class using the specified /// <see cref="IKeyboardSimulator" />, <see cref="IMouseSimulator" /> and <see cref="IInputDeviceStateAdaptor" /> /// instances. /// </summary> /// <param name="keyboardSimulator">The <see cref="IKeyboardSimulator" /> instance to use for simulating keyboard input.</param> /// <param name="mouseSimulator">The <see cref="IMouseSimulator" /> instance to use for simulating mouse input.</param> /// <param name="inputDeviceStateAdaptor"> /// The <see cref="IInputDeviceStateAdaptor" /> instance to use for interpreting the /// state of input devices. /// </param> public InputSimulator(IKeyboardSimulator keyboardSimulator, IMouseSimulator mouseSimulator, IInputDeviceStateAdaptor inputDeviceStateAdaptor) { _keyboardSimulator = keyboardSimulator; _mouseSimulator = mouseSimulator; _inputDeviceState = inputDeviceStateAdaptor; }
public XBoxControllerAsMouse() { _controller = new Controller(UserIndex.One); _mouseSimulator = new InputSimulator().Mouse; _keyboardSimulator = new InputSimulator().Keyboard; _timer = new System.Threading.Timer(obj => Update()); }
public InputSimulator(IKeyboardSimulator keyboardSimulator, IMouseSimulator mouseSimulator, IInputDeviceStateAdaptor inputDeviceStateAdaptor) { Keyboard = keyboardSimulator; Mouse = mouseSimulator; InputDeviceState = inputDeviceStateAdaptor; }
public KeyPlayer(Stopwatch stopwatch, LevelProfile levelProfile) { _stopwatch = stopwatch; _keyboard = new InputSimulator().Keyboard; _mouse = new InputSimulator().Mouse; _levelProfile = levelProfile; }
public CodedUiUiNavigationProvider(IMouseSimulator mouseSimulator, IKeyboardSimulator keyboardSimulator, ISettings settings, ILogger logger) { this.mouse = mouseSimulator; this.keyboard = keyboardSimulator; this.settings = settings; this.logger = logger; }
public ActionFactory(RootConfiguration config, IKeyboardSimulator keyboard, IMouseSimulator mouse, IMenuController menuController) { Config = config; Keyboard = keyboard; Mouse = mouse; MenuController = menuController; }
public ManipularItens() { var input = new InputSimulator(); mouse = input.Mouse; teclado = input.Keyboard; movimento = new MovimentosMouse(); }
public AppTarget(UserModel userModel) { _UserModel = userModel; _KeyboardSimulator = new KeyboardSimulator(); _MouseSimulator = new MouseSimulator(); _InputDeviceState = new WindowsInputDeviceStateAdaptor(); _MediaPlayer = new SoundPlayer("letter.wav"); _MediaPlayer.LoadAsync(); }
/// <summary> /// A class that uses OpenCV and WindowsInput to automate Windows using computer vision /// </summary> /// <param name="matchingAccuracy">specifies the matching accuracy used on the result of OpenCV MatchTemplate (0-1). 0.75 seems adequate</param> public Automator(double matchingAccuracy) { screenMaxWidth = Screen.PrimaryScreen.Bounds.Width; screenMaxHeight = Screen.PrimaryScreen.Bounds.Height; inputSimulator = new InputSimulator(); mouse = inputSimulator.Mouse; keyboard = inputSimulator.Keyboard; this.matchingAccuracy = matchingAccuracy; matchingType = TemplateMatchingType.CcoeffNormed; }
public MainWindow() { InitializeComponent(); controller = new Controller(UserIndex.One); mouseSimulator = new InputSimulator().Mouse; timer = new Timer(obj => Update()); Start(); }
public ProfileFactory( RootConfiguration rootConfiguration, IActionFactory actionFactory, IKeyboardSimulator keyboard, IMouseSimulator mouse, IMenuController menuController) { RootConfiguration = rootConfiguration; ActionFactory = actionFactory; Keyboard = keyboard; Mouse = mouse; MenuController = menuController; }
public static void MouseButtonClick(this IMouseSimulator mouse, MouseButton button) { switch (button) { case MouseButton.LeftButton: mouse.LeftButtonClick(); break; case MouseButton.RightButton: mouse.RightButtonClick(); break; default: break; } }
private static void OsuTap(ReplayFrame frame) { var timer = Menu.ReadMemory(Menu.TimerAddress, 4); var trackPosition = BitConverter.ToInt32(timer, 0); var frameX = GetScaledX(frame.X); var frameY = GetScaledY(frame.Y); var frameTime = frame.Time; var frameKey = frame.Keys; while (trackPosition < frameTime && Menu.IsRun) { Thread.Sleep(1); timer = Menu.ReadMemory(Menu.TimerAddress, 4); trackPosition = BitConverter.ToInt32(timer, 0); } Input.Mouse.MoveMouseTo(frameX, frameY); if (GetAsyncKeyState(Keys.LControlKey) != 0) { if (UseMouse) { Input.Mouse.LeftButtonUp(); Input.Mouse.RightButtonUp(); } Input.Keyboard.KeyUp(OsuLeft); Input.Keyboard.KeyUp(OsuRight); _replayIndex++; return; } if (UseMouse) { _mouseSimulator = (frameKey.HasFlag(KeyData.M1) && !frame.Keys.HasFlag(KeyData.K1)) ? Input.Mouse.LeftButtonDown() : Input.Mouse.LeftButtonUp(); _mouseSimulator = (frameKey.HasFlag(KeyData.M2) && !frame.Keys.HasFlag(KeyData.K2)) ? Input.Mouse.RightButtonDown() : Input.Mouse.RightButtonUp(); } _keyboardSimulator = frameKey.HasFlag(KeyData.K1) ? Input.Keyboard.KeyDown(OsuLeft) : Input.Keyboard.KeyUp(OsuLeft); _keyboardSimulator = frameKey.HasFlag(KeyData.K2) ? Input.Keyboard.KeyDown(OsuRight) : Input.Keyboard.KeyUp(OsuRight); _replayIndex++; }
public CodedUiUiItemWrapper( AutomationElement automationElement, IMouseSimulator mouseSimulator, IKeyboardSimulator keyboardSimulator, ILogger logger, ISettings settings, IAwaitingService awaitingService) { this.automationElement = automationElement ?? throw new ArgumentNullException(nameof(automationElement)); this.mouse = mouseSimulator ?? throw new ArgumentNullException(nameof(mouseSimulator)); this.keyboard = keyboardSimulator ?? throw new ArgumentNullException(nameof(keyboardSimulator)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.settings = settings ?? throw new ArgumentNullException(nameof(settings)); this.awaitingService = awaitingService ?? throw new ArgumentNullException(nameof(awaitingService)); this.visualTreeNavigationRetryCount = this.settings.VisualTreeNavigationRetryCount; }
public KeyPressActuator(IKeyboardSimulator keyboard, IMouseSimulator mouse, IEnumerable <VirtualKeyCode> keys, ModifierKeys modifiers) { Keyboard = keyboard; Mouse = mouse; var list = new List <VirtualKeyCode>(); foreach (var key in keys ?? Enumerable.Empty <VirtualKeyCode>()) { switch (key) { case VirtualKeyCode.MENU: modifiers |= ModifierKeys.Alt; break; case VirtualKeyCode.CONTROL: modifiers |= ModifierKeys.Control; break; case VirtualKeyCode.SHIFT: modifiers |= ModifierKeys.Shift; break; case VirtualKeyCode.LWIN: modifiers |= ModifierKeys.WinKey; break; default: list.Add(key); break; } } Keys = list; modifiersList = Utils.ModifiersToKeys(modifiers); Modifiers = modifiers; }
public void FireMouseEvent(IMouseSimulator a_ims, mousePacket a_mhs) { switch ((MouseEventFlag)a_mhs.flags) { case MouseEventFlag.MOUSEEVENTF_MOVE: a_ims.MoveMouseTo(a_mhs.x, a_mhs.y); break; case MouseEventFlag.MOUSEEVENTF_LEFTDOWN: a_ims.LeftButtonDown(); break; case MouseEventFlag.MOUSEEVENTF_LEFTUP: a_ims.LeftButtonUp(); break; case MouseEventFlag.MOUSEEVENTF_RIGHTDOWN: a_ims.RightButtonDown(); break; case MouseEventFlag.MOUSEEVENTF_RIGHTUP: a_ims.RightButtonUp(); break; case MouseEventFlag.MOUSEEVENTF_WHEEL: if (a_mhs.y > 0) { a_ims.VerticalScroll(3); } else { a_ims.VerticalScroll(-3); } break; } }
private Win32EmulatedMouse(IMouseSimulator mouseSimulator) { _mouseSimulator = mouseSimulator; }
public MouseScrollActuator(IMouseSimulator mouseSimulator) { MouseSimulator = mouseSimulator; }
/// <summary> /// Initializes a new instance of the <see cref="InputSimulator"/> class using the specified <see cref="IKeyboardSimulator"/>, <see cref="IMouseSimulator"/> and <see cref="IInputDeviceStateAdaptor"/> instances. /// </summary> /// <param name="keyboardSimulator">The <see cref="IKeyboardSimulator"/> instance to use for simulating keyboard input.</param> /// <param name="mouseSimulator">The <see cref="IMouseSimulator"/> instance to use for simulating mouse input.</param> /// <param name="inputDeviceStateAdaptor">The <see cref="IInputDeviceStateAdaptor"/> instance to use for interpreting the state of input devices.</param> public InputSimulator(IKeyboardSimulator keyboardSimulator, IMouseSimulator mouseSimulator, IInputDeviceStateAdaptor inputDeviceStateAdaptor) { Keyboard = keyboardSimulator; Mouse = mouseSimulator; InputDeviceState = inputDeviceStateAdaptor; }
public MouseMovementActuator(IMouseSimulator mouseSimulator) { MouseSimulator = mouseSimulator; }
public KeyPressActuator(IKeyboardSimulator keyboard, IMouseSimulator mouse, VirtualKeyCode key, ModifierKeys modifiers) : this(keyboard, mouse, new[] { key }, modifiers) { }
/// <summary> /// Initializes a new instance of the <see cref="InputSimulator"/> class using the default <see cref="KeyboardSimulator"/>, <see cref="MouseSimulator"/> and <see cref="WindowsInputDeviceStateAdaptor"/> instances. /// </summary> public InputSimulator() { _keyboardSimulator = new KeyboardSimulator(); _mouseSimulator = new MouseSimulator(); _inputDeviceState = new WindowsInputDeviceStateAdaptor(); }
internal MouseSimulatorExt(IMouseSimulator mouseSimulator) { this.mouseSimulator = mouseSimulator; }
public MouseSimulatorTests() { this.mouseSimulator = new MouseSimulator(Mock.Of <IInputMessageDispatcher>()); }
public KeyMapActuator(IKeyboardSimulator keyboard, IMouseSimulator mouse, IEnumerable <VirtualKeyCode> virtualKeys) { Keyboard = keyboard; Mouse = mouse; VirtualKeys = virtualKeys?.ToList() ?? new List <VirtualKeyCode>(0); }
public MouseServices(IMouseSimulator mouseSimulator, WowWindow _wowWindow) { this._wowWindow = _wowWindow; _mouseSimulator = mouseSimulator; }
public KeyPressActuator(IKeyboardSimulator keyboard, IMouseSimulator mouse, VirtualKeyCode key) : this(keyboard, mouse, new[] { key }, 0) { }
public static Win32EmulatedMouse FromMouseSimulator(IMouseSimulator simulator) { return(new Win32EmulatedMouse(simulator)); }
/// <summary> /// Initializes a new instance of the <see cref="InputSimulator"/> class using the specified <see cref="IKeyboardSimulator"/>, <see cref="IMouseSimulator"/> and <see cref="IInputDeviceStateAdaptor"/> instances. /// </summary> /// <param name="keyboardSimulator">The <see cref="IKeyboardSimulator"/> instance to use for simulating keyboard input.</param> /// <param name="mouseSimulator">The <see cref="IMouseSimulator"/> instance to use for simulating mouse input.</param> /// <param name="inputDeviceStateAdaptor">The <see cref="IInputDeviceStateAdaptor"/> instance to use for interpreting the state of input devices.</param> public InputSimulator(IKeyboardSimulator keyboardSimulator, IMouseSimulator mouseSimulator, IInputDeviceStateAdaptor inputDeviceStateAdaptor) { _keyboardSimulator = keyboardSimulator; _mouseSimulator = mouseSimulator; _inputDeviceState = inputDeviceStateAdaptor; }
private VirtualMouse() { _mouseSimulator = _inputSimulator.Mouse; }
/// <summary> /// Initializes a new instance of the <see cref="InputSimulator"/> class using the default <see cref="KeyboardSimulator"/>, <see cref="MouseSimulator"/> and <see cref="WindowsInputDeviceStateAdaptor"/> instances. /// </summary> public InputSimulator() { _keyboardSimulator = new KeyboardSimulator(this); _mouseSimulator = new MouseSimulator(this); _inputDeviceState = new WindowsInputDeviceStateAdaptor(); }
public KeyPressActuator(IKeyboardSimulator keyboard, IMouseSimulator mouse, IEnumerable <VirtualKeyCode> keys) : this(keyboard, mouse, keys, 0) { }