Drakemor's picture

CursorVisible on FullHD screens

Project:The Open Toolkit library
Category:bug report

Hi. I've found out that when you set CursorVisible=false it behaves diffrently depending on window position relative to the screen.

1) if window position.X is <= window.width - you can move mouse from left side of the *window* to the window.width
2) if window.position.X is > window.width - you can move mouse from left side of the *screen* to right

this means that if you have onMouseMove event you'll get e.X values like:
1) 50 - 750
2) -900 - 1020

Same thing goes to vertical values.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture


To narrow down the issue, do you mean you can physically move the mouse or that you can warp the mouse cursor (via SetPosition)?

A minimal test case that reproduces the issue would help a lot.

Drakemor's picture


OK. Code below. When I click RMB and drag my mouse to bottom right i expect to see 800, 600 or 799x599.
Instead I have 239, 359. When I move window to diffrent position i get behaviour described above.

using System;
using System.Collections.Generic;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
using OpenTK.Platform;
namespace ngine
    public class Game : GameWindow
        public Game() : base(800, 600){}
        protected override void OnLoad(EventArgs e)
            VSync = VSyncMode.On;
            Mouse.Move += new EventHandler<MouseMoveEventArgs>(Mouse_Move);
        void Mouse_Move(object sender, MouseMoveEventArgs e)
            if (!Mouse[MouseButton.Right]) return;
            Title = "X: "+Mouse.X + " Y: " + Mouse.Y;
        protected override void OnUpdateFrame(FrameEventArgs e)
            CursorVisible = !Mouse[MouseButton.Right];
        protected override void OnRenderFrame(FrameEventArgs fea)
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
        public static void Main()
            using (Game example = new Game())
the Fiddler's picture


Thanks, I'll take a look.

the Fiddler's picture


Status:open» need info

I haven't been able to reproduce this on my Ubuntu install (10.10, amd64, using fglrx). Can you please share your system information?

the Fiddler's picture


Status:need info» confirmed

I can reproduce this on Windows (please mention the OS where you encounter a bug! :) )