Sets a test key event stream for testing purposes.
void setTestKeyEvents(Stream<KeyEvent> stream) { _testKeyEvents = stream; }