Restricted mouse movement on Arduino

Hi, I have connected an optical mouse to Pro Mini. All works well, monitor displays coordinates. I have restricted x and y to become minimum 1 and max 8 (so 7 steps only). Works! Now the issue:

  1. if I move the mouse fast, it skips numbers (3,4,…7,8). It has to work that there is ALWAYS an increment of 1 when moving up/right (or-1 for down/left).
  2. if mouse is moving up (y coordinate) within +/- 30%, the x coordinate should not count. Likewise with horizontal movement +/- 30%, the y should not change.
    How to program that?
    Big thanks!