Detecting global mouse move

I need to detect if a user is present or not.
So my idea was to detect if the mouse is moving on Mac OS.
How can I get the mouse positions if my application doesen’t have the focus?
Thank you very much!

Thx Jason! … Sometimes its too easy.