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

Unified Diff: remoting/webapp/crd/js/desktop_connected_view.js

Issue 1153923007: Add a menu option for the right-hand Ctrl -> Meta mapping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and deepCopy. Created 5 years, 6 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/crd/html/window_frame.html ('k') | remoting/webapp/crd/js/options_menu.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
};
« no previous file with comments | « remoting/webapp/crd/html/window_frame.html ('k') | remoting/webapp/crd/js/options_menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698