public static System.Windows.Forms.MouseEventArgs ToWinFormArgs(MouseMoveEventArgs e, int x, int y) { #if FAMISTUDIO_MACOS // The OpenTK mouse state isnt reliable and often has buttons getting "stuck" // especially after things like resizing the window. Bypass it. var buttons = MacUtils.GetMouseButtons(); #else System.Windows.Forms.MouseButtons buttons = System.Windows.Forms.MouseButtons.None; if (e.Mouse.LeftButton == ButtonState.Pressed) { buttons = System.Windows.Forms.MouseButtons.Left; } else if (e.Mouse.MiddleButton == ButtonState.Pressed) { buttons = System.Windows.Forms.MouseButtons.Middle; } else if (e.Mouse.RightButton == ButtonState.Pressed) { buttons = System.Windows.Forms.MouseButtons.Right; } #endif return(new System.Windows.Forms.MouseEventArgs(buttons, 1, x, y, 0)); }