Fix xtermjs a11y bug about onKey

With IME, onKey doesn't work well, so xtermjs cannot clean up previous
content properly. So use onData instead.

https://github.com/xtermjs/xterm.js/pull/5221 is the upstream change.

Bug: 376827479
Bug: 376824356
Test: type something + enter, and then type something + space, and then
check talkback behavior.

Change-Id: I6dd2edf8a7aa4d7a29587581b5bd56108bfb7af3
diff --git a/build/debian/ttyd/cross-build.sh b/build/debian/ttyd/cross-build.sh
index dda8f78..e52c7df 100755
--- a/build/debian/ttyd/cross-build.sh
+++ b/build/debian/ttyd/cross-build.sh
@@ -120,6 +120,9 @@
 
 build_ttyd() {
     echo "=== Building ttyd (${TARGET})..."
+    # TODO: Remove this when https://github.com/xtermjs/xterm.js/pull/5221 is
+    # deployed
+    patch -p1 < $(dirname $0)/xtermjs_a11y.patch
     rm -rf build && mkdir -p build && cd build
     cmake -DCMAKE_TOOLCHAIN_FILE="${BUILD_DIR}/cross-${TARGET}.cmake" \
         -DCMAKE_INSTALL_PREFIX="${STAGE_DIR}" \