<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query_state(self, StateType):
 """ Is a button depressed? True if a button is pressed, false otherwise. """

        if StateType == M_LEFT:
            # Checking left mouse button
            return self.left_pressed
        elif StateType == M_MIDDLE:
            # Checking middle mouse button
            return self.middle_pressed
        elif StateType == M_RIGHT:
            # Checking right mouse button
            return self.right_pressed