With a button clicked the "GetMousePosition" dont work(version:4.8.3)

I need to poll a item into the scene from the inventory,so I need to get the mouse position.But the “GetMousePosition” don’t work with a item button is clicked.
Is there a problem with this situation,or is there any other way to get the mouse position?