GLFW cursor handling

Hi,
I’m using GLFW and want to create own cursor bitmap, so i disable showing cursor. I position a bitmap at read mouse position, but the resoults aren’t as I expect - mouse either doesn’t move or moves totally strange.
Any tips???

Hi!

That’s because when you disable the mouse cursor, the mouse position is not window bound anymore. You can think of the mouse position as the physical position reported by the mouse (e.g. x,y = -680234,5555342 is a fully valid mouse position when the mouse cursor is disabled).

It may also be a result of a known bug in the X11 version of GLFW, which causes the mouse sensitivity to be degraded when the mouse cursor is disabled. (the bug is fixable)

I think that it’s mostly the second thing you mentioned - and it depends
on the compilation of X11 / GLFW.
I knew that mouse pos would be reported as an integer from all the range,
so as soon as I open window I read mouse position and treat it as a reference.
How is this bug fixable and will it be fixed in forthcoming versions?

             Thanks for reply.

I reccon the bug is due to GLFWs way of constantly centering the (hidden) mouse cursor (in order to avoid running into the window edges). I think that the X server keeps track of sub-pixel information about the cursor position, which gets erased once the cursor position is forced to the center of the window.

The solution would be to center the cursor more seldom, for instance when the cursor has left some “threshold box” (e.g. half the way to the window edge). That would minimize the cursor position error.