Commit 04d6a834 authored by samhed's avatar samhed

Added variables for the keysums to make the code easier to read.

parent bd88b943
...@@ -764,39 +764,43 @@ showExtraKeys: function() { ...@@ -764,39 +764,43 @@ showExtraKeys: function() {
}, },
toggleCtrl: function() { toggleCtrl: function() {
var ctrlKeysum = 0xFFE3;
UI.keepKeyboard(); UI.keepKeyboard();
if(UI.ctrlOn === false) { if(UI.ctrlOn === false) {
UI.rfb.sendKey(0xFFE3, true); UI.rfb.sendKey(ctrlKeysum, true);
$D('toggleCtrlButton').className = "noVNC_status_button_selected"; $D('toggleCtrlButton').className = "noVNC_status_button_selected";
UI.ctrlOn = true; UI.ctrlOn = true;
} else if(UI.ctrlOn === true) { } else if(UI.ctrlOn === true) {
UI.rfb.sendKey(0xFFE3, false); UI.rfb.sendKey(ctrlKeysum, false);
$D('toggleCtrlButton').className = "noVNC_status_button"; $D('toggleCtrlButton').className = "noVNC_status_button";
UI.ctrlOn = false; UI.ctrlOn = false;
} }
}, },
toggleAlt: function() { toggleAlt: function() {
var altKeysum = 0xFFE9;
UI.keepKeyboard(); UI.keepKeyboard();
if(UI.altOn === false) { if(UI.altOn === false) {
UI.rfb.sendKey(0xFFE9, true); UI.rfb.sendKey(altKeysum, true);
$D('toggleAltButton').className = "noVNC_status_button_selected"; $D('toggleAltButton').className = "noVNC_status_button_selected";
UI.altOn = true; UI.altOn = true;
} else if(UI.altOn === true) { } else if(UI.altOn === true) {
UI.rfb.sendKey(0xFFE9, false); UI.rfb.sendKey(altKeysum, false);
$D('toggleAltButton').className = "noVNC_status_button"; $D('toggleAltButton').className = "noVNC_status_button";
UI.altOn = false; UI.altOn = false;
} }
}, },
sendTab: function() { sendTab: function() {
var tabKeysum = 0xFF09;
UI.keepKeyboard(); UI.keepKeyboard();
UI.rfb.sendKey(0xFF09); UI.rfb.sendKey(tabKeysum);
}, },
sendEsc: function() { sendEsc: function() {
var escKeysum = 0xFF1B;
UI.keepKeyboard(); UI.keepKeyboard();
UI.rfb.sendKey(0xFF1B); UI.rfb.sendKey(escKeysum);
}, },
setKeyboard: function() { setKeyboard: function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment