Changes to support APL characters

This commit is contained in:
Blake McBride 2016-05-13 19:15:15 -05:00
parent 628d41f32c
commit 863a8d91c7

View file

@ -2914,9 +2914,9 @@ VT100.prototype.fixEvent = function(event) {
// Some browsers fail to translate keys, if both shift and alt/meta is // Some browsers fail to translate keys, if both shift and alt/meta is
// pressed at the same time. We try to translate those cases, but that // pressed at the same time. We try to translate those cases, but that
// only works for US keyboard layouts. // only works for US keyboard layouts.
if (event.shiftKey) {
var u = undefined; var u = undefined;
var s = undefined; var s = undefined;
if (event.shiftKey) {
switch (this.lastNormalKeyDownEvent.keyCode) { switch (this.lastNormalKeyDownEvent.keyCode) {
case 39: /* ' -> " */ u = 39; s = 34; break; case 39: /* ' -> " */ u = 39; s = 34; break;
case 44: /* , -> < */ u = 44; s = 60; break; case 44: /* , -> < */ u = 44; s = 60; break;
@ -2957,6 +2957,13 @@ VT100.prototype.fixEvent = function(event) {
case 222: /* ' -> " */ u = 39; s = 34; break; case 222: /* ' -> " */ u = 39; s = 34; break;
default: break; default: break;
} }
} else {
var c = this.lastNormalKeyDownEvent.keyCode;
if (c >= 65 && c <= 90) {
u = c;
s = u | 32;
}
}
if (s && (event.charCode == u || event.charCode == 0)) { if (s && (event.charCode == u || event.charCode == 0)) {
var fake = [ ]; var fake = [ ];
fake.charCode = s; fake.charCode = s;
@ -2967,7 +2974,6 @@ VT100.prototype.fixEvent = function(event) {
fake.metaKey = event.metaKey; fake.metaKey = event.metaKey;
return fake; return fake;
} }
}
return event; return event;
}; };
@ -3052,10 +3058,8 @@ VT100.prototype.keyDown = function(event) {
} else { } else {
fake.charCode = 0; fake.charCode = 0;
fake.keyCode = event.keyCode; fake.keyCode = event.keyCode;
if (!alphNumKey && event.shiftKey) { }
fake = this.fixEvent(fake); fake = this.fixEvent(fake);
}
}
this.handleKey(fake); this.handleKey(fake);
this.lastNormalKeyDownEvent = undefined; this.lastNormalKeyDownEvent = undefined;
@ -3170,9 +3174,9 @@ VT100.prototype.keyUp = function(event) {
} else { } else {
fake.charCode = 0; fake.charCode = 0;
fake.keyCode = event.keyCode; fake.keyCode = event.keyCode;
if (!alphNumKey && (event.ctrlKey || event.altKey || event.metaKey)) {
fake = this.fixEvent(fake);
} }
if (event.ctrlKey || event.altKey || event.metaKey) {
fake = this.fixEvent(fake);
} }
this.lastNormalKeyDownEvent = undefined; this.lastNormalKeyDownEvent = undefined;
this.handleKey(fake); this.handleKey(fake);