The invention relates to a device (1) for actuating a locking mechanism of a window or a door by a rotational motion, wherein the actuating device (1) comprises means for mechanical blocking of the rotational motion. By means of a motion, in particular a linear motion, the mechanical means can be moved into a blocking position (21) that prevents the rotational motion of the actuating device (1) and a release position (22) that releases the rotational motion of the actuating device (1). The actuating device (1) also comprises an electronic module (27), which has at least one sensor and at least one electronic circuit for detecting an alarm state, wherein the electronic circuit is activated when the means for mechanical blocking are moved into the blocking position (21) and wherein the sensor can detect shaking and/or motion of the actuating device (1) and/or of the window or the door and can trigger an alarm function.