Fix up keyboard input so global handlers can prevent key events propagating