Return key pressed if there was nothing to do.

To achieve this, the way mapping is done have also changed.