def within_threshold(pos,item):

    """ Function: check if the tip of pressed is within the threshold of piano key boundaries
            Arguments: pos: x,y pixel coordinates of the tip of finger
                       item: boundaries of bbox of a particular key of a piano
            returns: boolean value"""

    if(pos[0]>item[0] and pos[0]<item[2] and pos[1]>item[1] and pos[1]<item[3]):
        return True
    else:
        return False