summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamhed <samuel@cendio.se>2016-04-26 23:41:58 +0200
committersamhed <samuel@cendio.se>2016-05-12 16:56:50 +0200
commitfdf21468d3a69fd0a2189317a03a11db135b40ed (patch)
treeac483dd1e0c68ddfbcc4f1a8a4e652fd0cdce6dd
parent9e45354efcc4a7519f213fc9f68165c77d07f431 (diff)
downloadnovnc-fdf21468d3a69fd0a2189317a03a11db135b40ed.tar.gz
Renamed and moved keyboard and mouse functions
-rw-r--r--include/ui.js88
1 files changed, 43 insertions, 45 deletions
diff --git a/include/ui.js b/include/ui.js
index 2315772..db0b3c1 100644
--- a/include/ui.js
+++ b/include/ui.js
@@ -208,7 +208,7 @@ var UI;
$D("showKeyboard").onclick = UI.showKeyboard;
$D("keyboardinput").oninput = UI.keyInput;
- $D("keyboardinput").onblur = UI.keyInputBlur;
+ $D("keyboardinput").onblur = UI.hideKeyboard;
$D("keyboardinput").onsubmit = function () { return false; };
$D("toggleExtraKeysButton").onclick = UI.toggleExtraKeys;
@@ -749,10 +749,6 @@ var UI;
return false;
},
- sendCtrlAltDel: function() {
- UI.rfb.sendCtrlAltDel();
- },
-
xvpShutdown: function() {
UI.rfb.xvpShutdown();
},
@@ -765,26 +761,6 @@ var UI;
UI.rfb.xvpReset();
},
- setMouseButton: function(num) {
- if (typeof num === 'undefined') {
- // Disable mouse buttons
- num = -1;
- }
- if (UI.rfb) {
- UI.rfb.get_mouse().set_touchButton(num);
- }
-
- var blist = [0, 1,2,4];
- for (var b = 0; b < blist.length; b++) {
- var button = $D('noVNC_mouse_button' + blist[b]);
- if (blist[b] === num) {
- button.style.display = "";
- } else {
- button.style.display = "none";
- }
- }
- },
-
// Display the desktop name in the document title
updateDocumentTitle: function(rfb, name) {
document.title = name + " - noVNC";
@@ -1042,6 +1018,26 @@ var UI;
}
},
+ setMouseButton: function(num) {
+ if (typeof num === 'undefined') {
+ // Disable mouse buttons
+ num = -1;
+ }
+ if (UI.rfb) {
+ UI.rfb.get_mouse().set_touchButton(num);
+ }
+
+ var blist = [0, 1,2,4];
+ for (var b = 0; b < blist.length; b++) {
+ var button = $D('noVNC_mouse_button' + blist[b]);
+ if (blist[b] === num) {
+ button.style.display = "";
+ } else {
+ button.style.display = "none";
+ }
+ }
+ },
+
// On touch devices, show the OS keyboard
showKeyboard: function() {
var kbi = $D('keyboardinput');
@@ -1060,6 +1056,16 @@ var UI;
}
},
+ hideKeyboard: function() {
+ $D('showKeyboard').className = "noVNC_status_button";
+ //Weird bug in iOS if you change keyboardVisible
+ //here it does not actually occur so next time
+ //you click keyboard icon it doesnt work.
+ UI.hideKeyboardTimeout = setTimeout(function() {
+ UI.keyboardVisible = false;
+ },100);
+ },
+
keepKeyboard: function() {
clearTimeout(UI.hideKeyboardTimeout);
if(UI.keyboardVisible === true) {
@@ -1148,14 +1154,6 @@ var UI;
}
},
- keyInputBlur: function() {
- $D('showKeyboard').className = "noVNC_status_button";
- //Weird bug in iOS if you change keyboardVisible
- //here it does not actually occur so next time
- //you click keyboard icon it doesnt work.
- UI.hideKeyboardTimeout = setTimeout(function() { UI.setKeyboard(); },100);
- },
-
toggleExtraKeys: function() {
UI.keepKeyboard();
if(UI.extraKeysVisible === false) {
@@ -1175,6 +1173,16 @@ var UI;
}
},
+ sendEsc: function() {
+ UI.keepKeyboard();
+ UI.rfb.sendKey(XK_Escape);
+ },
+
+ sendTab: function() {
+ UI.keepKeyboard();
+ UI.rfb.sendKey(XK_Tab);
+ },
+
toggleCtrl: function() {
UI.keepKeyboard();
if(UI.ctrlOn === false) {
@@ -1201,18 +1209,8 @@ var UI;
}
},
- sendTab: function() {
- UI.keepKeyboard();
- UI.rfb.sendKey(XK_Tab);
- },
-
- sendEsc: function() {
- UI.keepKeyboard();
- UI.rfb.sendKey(XK_Escape);
- },
-
- setKeyboard: function() {
- UI.keyboardVisible = false;
+ sendCtrlAltDel: function() {
+ UI.rfb.sendCtrlAltDel();
},
//Helper to add options to dropdown.