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

Unified Diff: ui/keyboard/resources/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/api_adapter.js
diff --git a/ui/keyboard/resources/api_adapter.js b/ui/keyboard/resources/api_adapter.js
index cd64f57d512088a8067c069761218caa83127797..4cfd98fe1137b2ee4f96dc1734792aa5f2484c9e 100644
--- a/ui/keyboard/resources/api_adapter.js
+++ b/ui/keyboard/resources/api_adapter.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,3 +11,12 @@ function logIfError() {
function insertText(text) {
chrome.experimental.input.virtualKeyboard.insertText(text, logIfError);
}
+
+function dispatchKeyEvent(type, char) {
+ if (!char || char.length != 1)
+ console.error('Invalid character.');
+ var charCode = char.charCodeAt(0);
+ chrome.experimental.input.virtualKeyboard.dispatchKeyEvent(type,
+ charCode,
+ logIfError);
+}

Powered by Google App Engine
This is Rietveld 408576698