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

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: Reviewer feedback. 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..6e9df11f5ec3d428ae320ce7658a2445b1410d22 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 is mapped to the Meta
+ * (Windows, Command) key.
+ */
+remoting.DesktopConnectedView.prototype.getMapRightCtrl = function() {
+ return this.host_.options.remapKeys[0x0700e4] === 0x0700e7;
+};
+
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()) {
+ 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