Directional attacks while the mouse is centre locked

I want to simulate the directional attack system seen in games like Mount and Blade (or Bleeding Blades if you like).
However, the player’s mouse is locked in the centre of the screen, so methods like getting the input objects delta aren’t going to work (as seen below).
https://gyazo.com/0bfcac405469cddd776f631d61ca50fd
(Notice how it prints X as 0 frequently despite my rapid mouse movement)

I’ve tried getting the player’s head lookvector and subtracting it from the previous lookvector, but the numbers I get just aren’t consistent.

Any suggestions?

The best way would probably to “listen” for inputs from the keyboard and incorporate that as a mechanic into your game. If the player is moving right and they attack, they could (for example) swing a sword from the left to the right (or whatever you wanted the attack to be).