lookup table

I want to adjusts the lookup table based on the position of
of the pointer within the window while the button of the mouse is pressed.
can anybody tell me what is the simple way to do it?
thanks