From a52b7e7a4eaf9b6a37876e6d980fd72d007b58e6 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 12 Jul 2016 16:50:07 -0700 Subject: [PATCH] Add starting point for IME support --- src/xterm.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/xterm.js b/src/xterm.js index a33261c0..6682f83a 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -579,6 +579,20 @@ // Truncate the textarea's value, since it is not needed this.value = ''; }, true); + + on(term.textarea, 'compositionstart', function(ev) { + console.log('compositionstart', ev); + // TODO: Set a composing flag + }); + on(term.textarea, 'compositionupdate', function(ev) { + console.log('compositionupdate', ev); + // TODO: Display text being composed in the UI (needs to be handled in keydown) + }); + on(term.textarea, 'compositionend', function(ev) { + console.log('compositionend', ev); + // TODO: Send composed text to the pty + // TODO: Remove composing flag + }); }; /** @@ -2464,6 +2478,8 @@ // Key Resources: // https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent Terminal.prototype.keyDown = function(ev) { + // TODO: Ignore event if currently composing text + var self = this; var result = this.evaluateKeyEscapeSequence(ev);