flushing buffer in KeyboardManager constructor