Mouse position setting

Is there a glut function that moves the mouse to a specific position? A similar function exists in the SDL (SDL_WarpMouse), but I want to stick to glut.

+3
source share
2 answers

I just found it, you just need to ask the right question, and google will help: D

Him glutWarpPointer(middleX, middleY);

+5
source

If you do not hide the pointer, it will be very ugly. I used this once for a class project and it did the trick, but it looked awful. but again, I used it to emulate purely relative mouse movements (basically, so that he couldn’t leave the window). But other than that, yes, it does the job.

+1
source

Source: https://habr.com/ru/post/1699269/


All Articles