Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: ui/keyboard/resources/webui/api_adapter.js

Issue 20145004: Switch from text insertion to key press and release events on the virtual k… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/keyboard/resources/webui/api_adapter.js
diff --git a/ui/keyboard/resources/webui/api_adapter.js b/ui/keyboard/resources/webui/api_adapter.js
index 1d24ba68bc2b80322c0a45cc3b66118dab793e44..b2c40fbfb4a3df0ca00657342db91e40349e4af1 100644
--- a/ui/keyboard/resources/webui/api_adapter.js
+++ b/ui/keyboard/resources/webui/api_adapter.js
@@ -5,3 +5,10 @@
function insertText(text) {
chrome.send('insertText', [ text ]);
}
+
+function dispatchKeyEvent(type, char) {
+ if (char.length != 1)
+ console.error('Invalid character.');
+ var charCode = char.charCodeAt(0);
+ chrome.send('dispatchKeyEvent', [type, charCode]);
+}

Powered by Google App Engine
This is Rietveld 408576698