What you need here is to reverse engineer how Canon sends the command to the recorder (or, if the recorder figures it out by itself, to know what it's looking for - display mode change, red dot or whatever).
Without reverse engineering, the easiest way would be to record RAW and H.264 simultaneously. This one fits into easy coding tasks.