diff --git a/shellinabox/shell_in_a_box.js b/shellinabox/shell_in_a_box.js index 294a914..04aa100 100644 --- a/shellinabox/shell_in_a_box.js +++ b/shellinabox/shell_in_a_box.js @@ -267,16 +267,16 @@ ShellInABox.prototype.keysPressed = function(ch) { } else if (c < 0x10000) { s += 'E' + hex.charAt( (c >> 12) ) + - hex.charAt(0x8 + (c >> 10) & 0x3 ) + + hex.charAt(0x8 + ((c >> 10) & 0x3)) + hex.charAt( (c >> 6) & 0xF ) + hex.charAt(0x8 + ((c >> 4) & 0x3)) + hex.charAt( c & 0xF ); } else if (c < 0x110000) { s += 'F' + hex.charAt( (c >> 18) ) + - hex.charAt(0x8 + (c >> 16) & 0x3 ) + + hex.charAt(0x8 + ((c >> 16) & 0x3)) + hex.charAt( (c >> 12) & 0xF ) + - hex.charAt(0x8 + (c >> 10) & 0x3 ) + + hex.charAt(0x8 + ((c >> 10) & 0x3)) + hex.charAt( (c >> 6) & 0xF ) + hex.charAt(0x8 + ((c >> 4) & 0x3)) + hex.charAt( c & 0xF ); diff --git a/shellinabox/vt100.js b/shellinabox/vt100.js index 222729e..1dafd7b 100644 --- a/shellinabox/vt100.js +++ b/shellinabox/vt100.js @@ -2719,10 +2719,14 @@ VT100.prototype.handleKey = function(event) { case 189: /* - */ ch = this.applyModifiers(45, event); break; case 190: /* . */ ch = this.applyModifiers(46, event); break; case 191: /* / */ ch = this.applyModifiers(47, event); break; - case 192: /* ` */ ch = this.applyModifiers(96, event); break; - case 219: /* [ */ ch = this.applyModifiers(91, event); break; + // Conflicts with dead key " on Swiss keyboards + //case 192: /* ` */ ch = this.applyModifiers(96, event); break; + // Conflicts with dead key " on Swiss keyboards + //case 219: /* [ */ ch = this.applyModifiers(91, event); break; case 220: /* \ */ ch = this.applyModifiers(92, event); break; - case 221: /* ] */ ch = this.applyModifiers(93, event); break; + // Conflicts with dead key ^ and ` on Swiss keaboards + // ^ and " on French keyboards + //case 221: /* ] */ ch = this.applyModifiers(93, event); break; case 222: /* ' */ ch = this.applyModifiers(39, event); break; default: return; } @@ -2892,21 +2896,36 @@ VT100.prototype.keyDown = function(event) { this.lastKeyDownEvent = undefined; this.lastNormalKeyDownEvent = event; + // Swiss keyboard conflicts: + // [ 59 + // ] 192 + // ' 219 (dead key) + // { 220 + // ~ 221 (dead key) + // } 223 + // French keyoard conflicts: + // ~ 50 (dead key) + // } 107 var asciiKey = event.keyCode == 32 || event.keyCode >= 48 && event.keyCode <= 57 || event.keyCode >= 65 && event.keyCode <= 90; var alphNumKey = asciiKey || + event.keyCode == 59 || event.keyCode >= 96 && event.keyCode <= 105 || + event.keyCode == 107 || + event.keyCode == 192 || + event.keyCode >= 219 && event.keyCode <= 221 || + event.keyCode == 223 || event.keyCode == 226; var normalKey = alphNumKey || - event.keyCode == 59 || event.keyCode == 61 || - event.keyCode == 106 || event.keyCode == 107 || + event.keyCode == 61 || + event.keyCode == 106 || event.keyCode >= 109 && event.keyCode <= 111 || - event.keyCode >= 186 && event.keyCode <= 192 || - event.keyCode >= 219 && event.keyCode <= 223 || + event.keyCode >= 186 && event.keyCode <= 191 || + event.keyCode == 222 || event.keyCode == 252; try { if (navigator.appName == 'Konqueror') { @@ -3034,10 +3053,14 @@ VT100.prototype.keyUp = function(event) { this.catchModifiersEarly = true; var asciiKey = event.keyCode == 32 || - event.keyCode >= 48 && event.keyCode <= 57 || + // Conflicts with dead key ~ (code 50) on French keyboards + //event.keyCode >= 48 && event.keyCode <= 57 || + event.keyCode >= 48 && event.keyCode <= 49 || + event.keyCode >= 51 && event.keyCode <= 57 || event.keyCode >= 65 && event.keyCode <= 90; var alphNumKey = asciiKey || + event.keyCode == 50 || event.keyCode >= 96 && event.keyCode <= 105; var normalKey = alphNumKey ||