Moving the Mouse

Monkey Targets Forums/Desktop/Moving the Mouse

therevills(Posted 2011) [#1]
Looking at the GLFW we can use glfwSetMousePosCallback(GLFWmouseposfun cbfun) to set the mouse position... but its a call back command, and I think it needs to be set when the window is started.

With Mojo code this is within the gxtkApp:Run class.

Around line 825 in mojo.glfw.cpp we need this:

glfwSetMousePosCallback(MousePosCallback)


But Im not sure where to put the rest of the code...

Any help?

http://gpwiki.org/index.php/OpenGL:Tutorials:Tutorial_Framework:Base


DGuy(Posted 2011) [#2]
Actually, that GLFW function is used to "SET" a callback function to "RECEIVE" mouse move events, not to set the position of the mouse cursor ... :)


therevills(Posted 2011) [#3]
Ahh I missed read doco... so can you set the mouse cursor position?


DGuy(Posted 2011) [#4]
Not via GLFW, so you'll have to make use of OS specific code.


therevills(Posted 2011) [#5]
Just found this command:

glfwSetMousePos(x, y);


Page 28 - 3.4.6:

http://www.glfw.org/GLFWReference27.pdf

Works for Windows at least...