SE Basic 4.0.5

Back-ported keyboard code from 4.1.0.