A heart cam mechanism comprising: a cam groove including a heart cam and surrounding cams (2,..., 5); and a lock pin (i) having one end part which is fixed and (ii) the other end part which is a sliding end part that slides while pushing against a bottom surface of the cam groove, the heart cam having a concave part for engaging with the sliding end part and releasing the engaging so as to switch between a locked state and an unlocked state of a switch whose contact point is opened or closed by a pressing operation, the sliding end part being configured to engage with the concave part at a locking position, the sliding end part being configured to simultaneously (i) make reciprocating motion in a pressing-operation direction in which the pressing operation is carried out and (ii) move, in the cam groove located outside the heart cam, along a heart-shaped path which is depressed at the locking position, the heart-shaped path having a first position which is a vertex position opposite the locking position and having a second position and a third position which are two vertex positions on a locking-position side, the sliding end part being configured to pass through the first position, the second position, the locking position, and the third position in this order, the heart cam having a first vertex, a second vertex, and a third vertex corresponding to the first position, the second position, and the third position of the heart-shaped path, respectively, a surrounding cam, which faces the concave part, having a locking position guiding point for guiding the sliding end part from the second position to the locking position, and the heart cam and the surrounding cams (2,..., 5) being provided such that, while the sliding end part is located at each one of the first position, the second position, the locking position, and the third position, a center part of the sliding end part is shifted from a corresponding one of reference lines toward part of the heart-shaped path where the sliding end part will move from said each one of the positions (1A, 1B, 1C) to a next position, the reference lines being respective lines extending in the pressing-operation direction from the first vertex, the second vertex, the locking position guiding point, and the third vertex, characterized in that, while a pathway extending from the second position to the locking position serves as a first pathway (31C 5, 31C 6) and a pathway extending from the locking position to the third position serves as a second pathway (31C 6, 31C 7), respective bottom surfaces of the first pathway (31C 5, 31C 6) and of the second pathway (31C 6, 31C 7) as viewed from a cross section perpendicular to the pressing-operation direction are inclined downwards from the second position to the third position in a pushing direction of the sliding end part. a cam groove including a heart cam and surrounding cams (2,..., 5); and a lock pin (i) having one end part which is fixed and (ii) the other end part which is a sliding end part that slides while pushing against a bottom surface of the cam groove, the heart cam having a concave part for engaging with the sliding end part and releasing the engaging so as to switch between a locked state and an unlocked state of a switch whose contact point is opened or closed by a pressing operation, the sliding end part being configured to engage with the concave part at a locking position, the sliding end part being configured to simultaneously (i) make reciprocating motion in a pressing-operation direction in which the pressing operation is carried out and (ii) move, in the cam groove located outside the heart cam, along a heart-shaped path which is depressed at the locking position, the heart-shaped path having a first position which is a vertex position opposite the locking position and having a second position and a third position which are two vertex positions on a locking-position side, the sliding end part being configured to pass through the first position, the second position, the locking position, and the third position in this order, the heart cam having a first vertex, a second vertex, and a third vertex corresponding to the first position, the second position, and the third position of the heart-shaped path, respectively, a surrounding cam, which faces the concave part, having a locking position guiding point for guiding the sliding end part from the second position to the locking position, and the heart cam and the surrounding cams (2,..., 5) being provided such that, while the sliding end part is located at each one of the first position, the second position, the locking position, and the third position, a center part of the sliding end part is shifted from a corresponding one of reference lines toward part of the heart-shaped path where the sliding end part will move from said each one of the positions (1A, 1B, 1C) to a next position, the reference lines being respective lines extending in the pressing-operation direction from the first vertex, the second vertex, the locking position guiding point, and the third vertex, characterized in that, while a pathway extending from the second position to the locking position serves as a first pathway (31C 5, 31C 6) and a pathway extending from the locking position to the third position serves as a second pathway (31C 6, 31C 7), respective bottom surfaces of the first pathway (31C 5, 31C 6) and of the second pathway (31C 6, 31C 7) as viewed from a cross section perpendicular to the pressing-operation direction are inclined downwards from the second position to the third position in a pushing direction of the sliding end part.