protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); CursorManager.OnMouseLeave(); InputApi.SetMousePosition(-1, -1); }
private void ctrlRenderer_MouseMove(object sender, MouseEventArgs e) { CursorManager.OnMouseMove(this); if (CursorManager.NeedMouseIcon) { this.Cursor = Cursors.Cross; } double xPos = (double)e.X / this.Width; double yPos = (double)e.Y / this.Height; xPos = Math.Max(0.0, Math.Min(1.0, xPos)); yPos = Math.Max(0.0, Math.Min(1.0, yPos)); InputApi.SetMousePosition(xPos, yPos); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); ScreenSize size = EmuApi.GetScreenSize(false); int leftMargin = (this.Width - size.Width) / 2; int topMargin = (this.Height - size.Height) / 2; CursorManager.OnMouseMove(this); if (CursorManager.NeedMouseIcon) { this.Cursor = Cursors.Cross; } double xPos = (double)(e.X - leftMargin) / size.Width; double yPos = (double)(e.Y - topMargin) / size.Height; xPos = Math.Max(0.0, Math.Min(1.0, xPos)); yPos = Math.Max(0.0, Math.Min(1.0, yPos)); InputApi.SetMousePosition(xPos, yPos); }
private void ctrlRenderer_MouseLeave(object sender, EventArgs e) { CursorManager.OnMouseLeave(); InputApi.SetMousePosition(-1, -1); }