Fixed keyboard exception issue on older Safari browsers.

This commit is contained in:
Ylian Saint-Hilaire 2020-12-02 16:25:35 -08:00
parent cfb62dc313
commit b1f9b5569e
2 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -535,13 +535,13 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
obj.xxMouseWheel = function (e) { if (obj.State == 3) { obj.SendMouseMsg(obj.KeyAction.SCROLL, e); return false; } return true; } obj.xxMouseWheel = function (e) { if (obj.State == 3) { obj.SendMouseMsg(obj.KeyAction.SCROLL, e); return false; } return true; }
obj.xxKeyUp = function (e) { obj.xxKeyUp = function (e) {
if ((e.key != 'Dead') && (obj.State == 3)) { if ((e.key != 'Dead') && (obj.State == 3)) {
if ((e.key.length == 1) && (e.ctrlKey != true) && (e.altKey != true) && ((obj.remoteKeyMap == false) || (obj.debugmode > 0))) { obj.SendKeyUnicode(obj.KeyAction.UP, e.key.charCodeAt(0)); } else { obj.SendKeyMsg(obj.KeyAction.UP, e); } if ((typeof e.key == 'string') && (e.key.length == 1) && (e.ctrlKey != true) && (e.altKey != true) && ((obj.remoteKeyMap == false) || (obj.debugmode > 0))) { obj.SendKeyUnicode(obj.KeyAction.UP, e.key.charCodeAt(0)); } else { obj.SendKeyMsg(obj.KeyAction.UP, e); }
} }
if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false;
} }
obj.xxKeyDown = function (e) { obj.xxKeyDown = function (e) {
if ((e.key != 'Dead') && (obj.State == 3)) { if ((e.key != 'Dead') && (obj.State == 3)) {
if (!((e.key.length == 1) && (e.ctrlKey != true) && (e.altKey != true) && ((obj.remoteKeyMap == false) || (obj.debugmode > 0)))) { if (!((typeof e.key == 'string') && (e.key.length == 1) && (e.ctrlKey != true) && (e.altKey != true) && ((obj.remoteKeyMap == false) || (obj.debugmode > 0)))) {
obj.SendKeyMsg(obj.KeyAction.DOWN, e); obj.SendKeyMsg(obj.KeyAction.DOWN, e);
if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false;
} }
@ -549,7 +549,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
} }
obj.xxKeyPress = function (e) { obj.xxKeyPress = function (e) {
if ((e.key != 'Dead') && (obj.State == 3)) { if ((e.key != 'Dead') && (obj.State == 3)) {
if ((e.key.length == 1) && (e.ctrlKey != true) && (e.altKey != true) && ((obj.remoteKeyMap == false) || (obj.debugmode > 0))) { obj.SendKeyUnicode(obj.KeyAction.DOWN, e.key.charCodeAt(0)); } //else { obj.SendKeyMsg(obj.KeyAction.DOWN, e); } if ((typeof e.key == 'string') && (e.key.length == 1) && (e.ctrlKey != true) && (e.altKey != true) && ((obj.remoteKeyMap == false) || (obj.debugmode > 0))) { obj.SendKeyUnicode(obj.KeyAction.DOWN, e.key.charCodeAt(0)); } //else { obj.SendKeyMsg(obj.KeyAction.DOWN, e); }
} }
if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false;
} }