Project Migration, slight modification to keypress handling in js