Give the attached action a try.
I'm getting mixed feedback on using the Visibility flag, it doesn't work in my tests but others report it fine.. Let me know.
The action doesn't work for me.
I work on two monitors, so when it locks the cursor, it chooses a monitor at random and centers the cursor to the that monitor, but does not lock it.
It also doesn't hide the cursor eitehr.