Drakemor's picture

CursorVisible on FullHD screens

Project:The Open Toolkit library
Version:1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:confirmed
Description

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.


Comments

Comment viewing options

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

#1

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

#2

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)
        {
            base.OnLoad(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)
        {
            base.OnUpdateFrame(e);
            CursorVisible = !Mouse[MouseButton.Right];
            System.Threading.Thread.Sleep(1);
        }
 
        protected override void OnRenderFrame(FrameEventArgs fea)
        {
            base.OnRenderFrame(fea);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            SwapBuffers();
            System.Threading.Thread.Sleep(1);
        }
 
        [STAThread]
        public static void Main()
        {
            using (Game example = new Game())
            {
                example.Run(60);
            }
        }
    }
}
the Fiddler's picture

#3

Thanks, I'll take a look.

the Fiddler's picture

#4

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

#5

Status:need info» confirmed

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

Investigating.