Safety commit. Keystroke output almost working.
Window focus management now works.