• Advertisement
Sign in to follow this  

[SharpDX] Correctly handle mouse delta in Raw input

This topic is 1038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I am writing my own handler for RawInput in sharpDX and for now I am stuck with mouse events.

The thing is that I want to receive mouse delta X and Y, but faced with the issue. When there is no mouse movement, mouse delta keep staying at the last value, which is not 0, so, even if I dont move mouse, my camera (for ex.) still will be rotating, because Delta in not 0.

 

Could someone share experience how to handle this thing correctly?

 

Also I would like to know how to get absolute mouse coordinates from raw input, because for know I am getting only delta values..

Edited by BlackJoker

Share this post


Link to post
Share on other sites
Advertisement

Ok, seems I get it myself. 

I found out that mouse can send more than one event before my input update mehod with called and I used earlier only last deltas. SO, movement was jerky.

Now I create a buffer for deltas and update camera rotation in loop.

Now camera rotations become much smoother.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement