check the tutorial by Timothy Ricks
Magnetic cursor