c++ - Trap cursor in Window -


i wrote own cameraclass in c++ using dx11. @ moment use wm_mousemove events around in scene. prevent cursur out of window, call function setcursorpos center mouse whenever wm_mousemove event occurs. if move mouse fast, cursor gets out of window. solution using function clipcursor, leads falter rotation of camera when cursor hits border of rect. clipcursor solved original problem, ended in another.

do guys have solution that?

the regular windows message not best solution drive precise controls. inherit os acceleration system, clipping , depends on other shenanigans can see.

the best api receive mouse inputs raw input. has advantage expose better dpi , polling rate hardware can provide , free of under hood manipulation. once read mouse this, free use setcapture , clipcursor prevent unwanted click other window.

you can find documentation here : https://msdn.microsoft.com/en-us/library/windows/desktop/ms645536(v=vs.85).aspx


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -