Respond to changes in key state when ask prompt is focused

Fixes an issue in https://github.com/nathan/phosphorus/issues/265.