Index: remoting/webapp/crd/js/desktop_connected_view.js |
diff --git a/remoting/webapp/crd/js/desktop_connected_view.js b/remoting/webapp/crd/js/desktop_connected_view.js |
index eced1b2ebbe2900efc910c82c29ee6e8c27555a7..2f7dfee2e399fe435c7abba9a62b6165675ff08f 100644 |
--- a/remoting/webapp/crd/js/desktop_connected_view.js |
+++ b/remoting/webapp/crd/js/desktop_connected_view.js |
@@ -106,6 +106,14 @@ remoting.DesktopConnectedView.prototype.getResizeToClient = function() { |
return false; |
}; |
+/** |
+ * @return {boolean} True if the right-hand Ctrl key should be remapped to the |
kelvinp
2015/06/05 20:47:58
s/should be remapped/is current mapped
Jamie
2015/06/05 20:58:41
Done.
|
+ * Meta (Windows, Command) key. |
+ */ |
+remoting.DesktopConnectedView.prototype.getMapRightCtrl = function() { |
+ return this.host_.options.remapKeys[0x0700e4] == 0x0700e7; |
kelvinp
2015/06/05 20:47:58
use === equals
Jamie
2015/06/05 20:58:41
Done.
|
+}; |
+ |
remoting.DesktopConnectedView.prototype.toggleStats = function() { |
this.stats_.toggle(); |
}; |
@@ -235,6 +243,25 @@ remoting.DesktopConnectedView.prototype.onFullScreenChanged_ = function ( |
}; |
/** |
+ * Set whether or not the right-hand Ctrl key should send the Meta (Windows, |
+ * Command) key-code. |
+ * |
+ * @param {boolean} enable True to enable the mapping; false to disable. |
+ */ |
+remoting.DesktopConnectedView.prototype.setMapRightCtrl = function(enable) { |
+ if (enable === this.getMapRightCtrl()) { |
kelvinp
2015/06/05 20:47:58
Nit: No need to use === to compare with boolean, e
Jamie
2015/06/05 20:58:41
I'm not comparing to true; I'm early-exiting if th
kelvinp
2015/06/06 00:54:26
Sorry, I misread
|
+ return; // In case right Ctrl is mapped, but not to right Meta. |
+ } |
+ |
+ if (enable) { |
+ this.host_.options.remapKeys[0x0700e4] = 0x0700e7; |
+ } else { |
+ delete this.host_.options.remapKeys[0x0700e4] |
+ } |
+ this.setRemapKeys(this.host_.options.remapKeys); |
+}; |
+ |
+/** |
* Sends a Ctrl-Alt-Del sequence to the remoting client. |
* |
* @return {void} Nothing. |
@@ -263,7 +290,8 @@ remoting.DesktopConnectedView.prototype.sendPrintScreen = function() { |
remoting.DesktopConnectedView.prototype.setRemapKeys = function(remappings) { |
this.plugin_.setRemapKeys(remappings); |
// Save the new remapping setting. |
- this.host_.options.remapKeys = remappings; |
+ this.host_.options.remapKeys = |
+ /** @type {!Object} */ (base.deepCopy(remappings)); |
this.host_.options.save(); |
}; |