keyboard stuff

Add a user callback for pre process record (#20584) master