]> andersk Git - test.git/commitdiff
Additional fixes for dealing with keyboard layouts that need AltGr as a
authorMarkus Gutschke <markus@shellinabox.com>
Tue, 30 Jun 2009 17:14:35 +0000 (17:14 +0000)
committerMarkus Gutschke <markus@shellinabox.com>
Tue, 30 Jun 2009 17:14:35 +0000 (17:14 +0000)
second level chooser.

config.h
configure
configure.ac
demo/vt100.js
shellinabox/shell_in_a_box.js
shellinabox/vt100.js
shellinabox/vt100.jspp

index dfc43290126477d4ad1174f8de223d45a2f5d365..035fcc69e3cf054e43c4e5d819a21c9edf19f44e 100644 (file)
--- a/config.h
+++ b/config.h
 #define STDC_HEADERS 1
 
 /* Most recent revision number in the version control system */
-#define VCS_REVISION "132"
+#define VCS_REVISION "133"
 
 /* Version number of package */
 #define VERSION "2.8"
index c3143906c4be7e6051d6477f2d1f983af19f86e4..62bf4300ab68c0617816e6e1047085dc09ace26b 100755 (executable)
--- a/configure
+++ b/configure
@@ -2037,7 +2037,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-VCS_REVISION=132
+VCS_REVISION=133
 
 
 cat >>confdefs.h <<_ACEOF
index 68e6c7ec31e36fee3540a15c60a2f0a128634608..cc42ad4766888f61407a2d585745520c56432795 100644 (file)
@@ -2,7 +2,7 @@ AC_PREREQ(2.57)
 
 dnl This is the one location where the authoritative version number is stored
 AC_INIT(shellinabox, 2.8, markus@shellinabox.com)
-VCS_REVISION=132
+VCS_REVISION=133
 AC_SUBST(VCS_REVISION)
 AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
                    [Most recent revision number in the version control system])
index b8b7653f1a29286ca6f835bf2da0927890536a93..603d1ae4a28651377bd06333e7cc6badff46a182 100644 (file)
@@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.8 (revision 132)" +
+  alert("VT100 Terminal Emulator " + "2.8 (revision 133)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
@@ -1840,6 +1840,20 @@ VT100.prototype.checkComposedKeys = function(event) {
 };
 
 VT100.prototype.fixEvent = function(event) {
+  // Some browsers report AltGR as a combination of ALT and CTRL. As AltGr
+  // is used as a second-level selector, clear the modifier bits before
+  // handling the event.
+  if (event.ctrlKey && event.altKey) {
+    var fake                = [ ];
+    fake.charCode           = event.charCode;
+    fake.keyCode            = event.keyCode;
+    fake.ctrlKey            = false;
+    fake.shiftKey           = event.shiftKey;
+    fake.altKey             = false;
+    fake.metaKey            = event.metaKey;
+    return fake;
+  }
+
   // 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
   // only works for US keyboard layouts.
@@ -1939,7 +1953,11 @@ VT100.prototype.keyDown = function(event) {
   // In fact, we see them, but we cannot stop IE from seeing them, too.
   if ((event.charCode || event.keyCode) &&
       ((alphNumKey && (event.ctrlKey || event.altKey || event.metaKey) &&
-        !event.shiftKey) ||
+        !event.shiftKey &&
+        // Some browsers signal AltGR as both CTRL and ALT. Do not try to
+        // interpret this sequence ourselves, as some keyboard layouts use
+        // it for second-level layouts.
+        !(event.ctrlKey && event.altKey)) ||
        this.catchModifiersEarly && normalKey && !alphNumKey &&
        (event.ctrlKey || event.altKey || event.metaKey) ||
        !normalKey)) {
index 4268e78b35122ee8726d72593e6f28cbca2a52ab..a2481679a32b2da5150d52f7bc4a6a651050afaa 100644 (file)
@@ -355,7 +355,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
 };
 
 ShellInABox.prototype.about = function() {
-  alert("Shell In A Box version " + "2.8 (revision 132)" +
+  alert("Shell In A Box version " + "2.8 (revision 133)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com" +
         (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?
index b8b7653f1a29286ca6f835bf2da0927890536a93..603d1ae4a28651377bd06333e7cc6badff46a182 100644 (file)
@@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.8 (revision 132)" +
+  alert("VT100 Terminal Emulator " + "2.8 (revision 133)" +
         "\nCopyright 2008-2009 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
@@ -1840,6 +1840,20 @@ VT100.prototype.checkComposedKeys = function(event) {
 };
 
 VT100.prototype.fixEvent = function(event) {
+  // Some browsers report AltGR as a combination of ALT and CTRL. As AltGr
+  // is used as a second-level selector, clear the modifier bits before
+  // handling the event.
+  if (event.ctrlKey && event.altKey) {
+    var fake                = [ ];
+    fake.charCode           = event.charCode;
+    fake.keyCode            = event.keyCode;
+    fake.ctrlKey            = false;
+    fake.shiftKey           = event.shiftKey;
+    fake.altKey             = false;
+    fake.metaKey            = event.metaKey;
+    return fake;
+  }
+
   // 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
   // only works for US keyboard layouts.
@@ -1939,7 +1953,11 @@ VT100.prototype.keyDown = function(event) {
   // In fact, we see them, but we cannot stop IE from seeing them, too.
   if ((event.charCode || event.keyCode) &&
       ((alphNumKey && (event.ctrlKey || event.altKey || event.metaKey) &&
-        !event.shiftKey) ||
+        !event.shiftKey &&
+        // Some browsers signal AltGR as both CTRL and ALT. Do not try to
+        // interpret this sequence ourselves, as some keyboard layouts use
+        // it for second-level layouts.
+        !(event.ctrlKey && event.altKey)) ||
        this.catchModifiersEarly && normalKey && !alphNumKey &&
        (event.ctrlKey || event.altKey || event.metaKey) ||
        !normalKey)) {
index 7c59a03204118be8ff967c0c3a0f7d1661b72cdd..cf02eca410767a7f3776b385259ed52727e40a8b 100644 (file)
@@ -1840,6 +1840,20 @@ VT100.prototype.checkComposedKeys = function(event) {
 };
 
 VT100.prototype.fixEvent = function(event) {
+  // Some browsers report AltGR as a combination of ALT and CTRL. As AltGr
+  // is used as a second-level selector, clear the modifier bits before
+  // handling the event.
+  if (event.ctrlKey && event.altKey) {
+    var fake                = [ ];
+    fake.charCode           = event.charCode;
+    fake.keyCode            = event.keyCode;
+    fake.ctrlKey            = false;
+    fake.shiftKey           = event.shiftKey;
+    fake.altKey             = false;
+    fake.metaKey            = event.metaKey;
+    return fake;
+  }
+
   // 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
   // only works for US keyboard layouts.
@@ -1939,7 +1953,11 @@ VT100.prototype.keyDown = function(event) {
   // In fact, we see them, but we cannot stop IE from seeing them, too.
   if ((event.charCode || event.keyCode) &&
       ((alphNumKey && (event.ctrlKey || event.altKey || event.metaKey) &&
-        !event.shiftKey) ||
+        !event.shiftKey &&
+        // Some browsers signal AltGR as both CTRL and ALT. Do not try to
+        // interpret this sequence ourselves, as some keyboard layouts use
+        // it for second-level layouts.
+        !(event.ctrlKey && event.altKey)) ||
        this.catchModifiersEarly && normalKey && !alphNumKey &&
        (event.ctrlKey || event.altKey || event.metaKey) ||
        !normalKey)) {
This page took 0.103642 seconds and 5 git commands to generate.