private void OnGlobalHookMouseMove(object sender, MouseMoveEventArgs e) { //don't process a hook event within 2 seconds of a server event #if BailClient if (ShouldHookBailMouse()) { return; } ClientState.LastHookEvent_Mouse = DateTime.UtcNow; #endif CoordinateUpdateResult result = _screen.UpdateVirtualMouseCoordinates(e); if (result.MoveMouse) { //Console.WriteLine("Moving mouse to a position"); Hook.SetMousePos(ClientState.LastPositionX, ClientState.LastPositionY); } if (result.IsValid) { #if QUEUE_CLIENT //send over the net _dispatcher.Process(new MouseMoveMessage(ClientState.VirtualX, ClientState.VirtualY)); #else _dispatcher.Send(MouseMoveMessage.GetBytes(ClientState.VirtualX, ClientState.VirtualY)); #endif } }
private void ProcessMouseMoveMessage(MouseMoveMessage message) { //TODO (CR May 2010): should we remove this code? We should be very careful if we do. //Theoretically, this could limit us to 10 fps. Event ack = new MouseMoveProcessedEvent() { Identifier = Guid.NewGuid(), SenderId = this.Identifier }; ApplicationContext.FireEvent(ack); MouseButtons mouseButtons = MouseButtons.None; switch (message.Button) { case MouseButton.Left: mouseButtons = MouseButtons.Left; break; case MouseButton.Right: mouseButtons = MouseButtons.Right; break; } MouseEventArgs e = new MouseEventArgs(mouseButtons, 0, message.MousePosition.X, message.MousePosition.Y, 0); object msg = _tileInputTranslator.OnMouseMove(e); _tileController.ProcessMessage(msg); }
private void SendMouseMoveMessage() { if (_destroyed) { return; } Point pos = _currentMousePosition; Message msg = new MouseMoveMessage { Identifier = Guid.NewGuid(), TargetId = ServerEntity.Identifier, MousePosition = new Position { X = (int)pos.X, Y = (int)pos.Y }, Button = MouseButton.None, MouseButtonState = MouseButtonState.Up }; _eventMediator.DispatchMessage(msg); }
public void MouseMove(MouseMoveMessage m) { }
public void MouseMove(MouseMoveMessage m) { throw new System.NotImplementedException(); }
public void MouseMove(MouseMoveMessage m) { _hover = _background.Contains(m.Position); }