Index: remoting/webapp/me2mom/remoting.js |
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js |
index dad9809dbfa8312dd2ebaefbc6ba19ec629dc0bf..8ba24360c2463a1d0b5320b890cd88e93c34e46d 100644 |
--- a/remoting/webapp/me2mom/remoting.js |
+++ b/remoting/webapp/me2mom/remoting.js |
@@ -7,6 +7,16 @@ var remoting = remoting || {}; |
(function() { |
"use strict"; |
+window.addEventListener('blur', pluginLostFocus_, false); |
+ |
+function pluginLostFocus_() { |
+ // If the plug loses input focus, release all keys as a precaution against |
+ // leaving them 'stuck down' on the host. |
+ if (remoting.session && remoting.session.plugin) { |
+ remoting.session.plugin.releaseAllKeys(); |
+ } |
+} |
+ |
/** @enum {string} */ |
remoting.AppMode = { |
CLIENT: 'client', |