If the requirement is to implement it with a keyboard, I recommend appropriate documentation: The application works only if autorepeat is turned off in the underlying window manager. By design, Qt can't control or override the window manager.
One alternative is to use the mouse instead.
Another alternative is to toggle recording with a click.
That's essentially what all the recording and DAW applications that I know/use do: Audacity, Ardour, ...