Just like you are getting the views locations in the screen's coordinate space using getLocationOnScreen() for a more robust design, you should be using the button's width and height instead of hard-coded offsets to place the curser in the center of the button. This way if the widths or heights of your buttons change, you won't have to manually change these hard coded offsets to keep the cursor in the center of the button.