Move recording of keys to the input handler itself instead of the Insert mode so that eventual nested modes (potentially introduced by <a-;> will get their keys recorded as well). Fixes #1680