Made a listener for cursor movement