Joystick style control with the mouse?

I haven’t been able to find anything relating to this so I thought I’d try here. I’m looking to set up a space combat game that would fly as if you’re using a joystick but using the mouse. A fine example of this would be from the space combat on Star Wars Galaxies.

I want it so, if I move my mouse to the right, the ship will continue to head in that direction until I bring the mouse back to the center of the screen, which will cause it to head straight again.

Any help would be greatly appreciated!