I've had the same problem, i was using (and still) a bluethooth mouse with a small usb input into my laptop, On my desktop PC it worked completely fine i think. But on my laptop i swapped it out alot, sometimes i inserted the usb and i couldnt fight in minecraft while sprinting, because i put it in a USB 2.0 (the blue usb input) and that for some reason didnt match with my mouse, now i have put the mouse in a normal USB input (for me yellow) and it is working fine!
Let me know if you got an update ;)
Poppy