This is the plan what IgnoreKey will need to do.

IgnoreKey will set the key ignore flag. According to Hero Mesh documentation, FlushClass(-1) and IgnoreKey() will both prevent MSG_BEGIN_TURN (just called BEGIN_TURN in Free Hero Mesh).

The key ignore flag cannot be set after the input phase is completed, and will be cleared if there are any changes to the game state. Write operations (except to the stack) change the game state, and so does WinLevel, but LoseLevel and LocateMe are not considered to change the game state, and read-only operations don't change the game state. Popup messages are considered to change the state only if the displayed popup message contains quiz buttons.

If the key ignore flag is set, this will usually cause it not to record the key. Exception: If replaying a move, it will always advance the replay, even if the key ignore flag is set, unless it displayed a popup message (without quiz buttons), but acknowledging a popup message does cause advancing the replay. However, if playing normally, then the recording is skipped if acknowledging a popup message with no quiz buttons if the key ignore flag was set on the move that resulted in the popup message.