Getting the current cursor coordinates

Is there a way to make a Pixel object based on the current mouse cursor position?