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

Unified Diff: remoting/webapp/client_plugin_async.js

Issue 9968030: Add an injectKeyEvent API to the Chromoting client plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 9 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
« no previous file with comments | « remoting/webapp/client_plugin.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_plugin_async.js
diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js
index e85faa40f51a096d02c2187085924ae5b883e21f..29ba91f267c8c14072a97ee7d47ab4f18a057761 100644
--- a/remoting/webapp/client_plugin_async.js
+++ b/remoting/webapp/client_plugin_async.js
@@ -267,6 +267,21 @@ remoting.ClientPluginAsync.prototype.releaseAllKeys = function() {
};
/**
+ * Send a key event to the host.
+ *
+ * @param {number} usb_keycode The USB-style code of the key to inject.
+ * @param {boolean} pressed True to inject a key press, False for a release.
+ */
+remoting.ClientPluginAsync.prototype.injectKey =
+ function(usb_keycode, pressed) {
+ this.plugin.postMessage(JSON.stringify(
+ { method: 'injectKeyEvent', data: {
+ 'usb_keycode': usb_keycode,
+ 'pressed': pressed}
+ }));
+};
+
+/**
* Returns an associative array with a set of stats for this connecton.
*
* @return {remoting.ClientSession.PerfStats} The connection statistics.
« no previous file with comments | « remoting/webapp/client_plugin.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698