Mouse clicks stop working

Game suddenly stops registering my mouse clicks, any sort of click(left, right, 4 and 5), still able to look around, and this only happens in this game so not something hardware related, anyway im using a logitech g502.
This is something really annoying as it happens a lot, and lasts a couple of seconds till it goes back to normal.