Confine controls to an area (startrooper)

in the star trooper demo the slider controls have a graphic to show where it is, but you can move it from anywhere on the screen, often accidentally. How can i make the Slider only move if you touch in the side area where the graphic is?

check if the touch position is within the specified rect or right / left of a specific x position etc