#INPUT, integrated with save/restore hooks