Additional fixes for dealing with keyboard layouts that need AltGr as a

second level chooser.


git-svn-id: https://shellinabox.googlecode.com/svn/trunk@133 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
zodiac 2009-06-30 17:14:35 +00:00
parent f613bc1ca8
commit ee1cd17b18
7 changed files with 63 additions and 9 deletions

View file

@ -132,7 +132,7 @@
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Most recent revision number in the version control system */ /* Most recent revision number in the version control system */
#define VCS_REVISION "132" #define VCS_REVISION "133"
/* Version number of package */ /* Version number of package */
#define VERSION "2.8" #define VERSION "2.8"

2
configure vendored
View file

@ -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 ac_compiler_gnu=$ac_cv_c_compiler_gnu
VCS_REVISION=132 VCS_REVISION=133
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF

View file

@ -2,7 +2,7 @@ AC_PREREQ(2.57)
dnl This is the one location where the authoritative version number is stored dnl This is the one location where the authoritative version number is stored
AC_INIT(shellinabox, 2.8, markus@shellinabox.com) AC_INIT(shellinabox, 2.8, markus@shellinabox.com)
VCS_REVISION=132 VCS_REVISION=133
AC_SUBST(VCS_REVISION) AC_SUBST(VCS_REVISION)
AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}", AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
[Most recent revision number in the version control system]) [Most recent revision number in the version control system])

View file

@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() {
}; };
VT100.prototype.about = 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" + "\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com"); "For more information check http://shellinabox.com");
}; };
@ -1840,6 +1840,20 @@ VT100.prototype.checkComposedKeys = function(event) {
}; };
VT100.prototype.fixEvent = 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 // 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.
@ -1939,7 +1953,11 @@ VT100.prototype.keyDown = function(event) {
// In fact, we see them, but we cannot stop IE from seeing them, too. // In fact, we see them, but we cannot stop IE from seeing them, too.
if ((event.charCode || event.keyCode) && if ((event.charCode || event.keyCode) &&
((alphNumKey && (event.ctrlKey || event.altKey || event.metaKey) && ((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 && this.catchModifiersEarly && normalKey && !alphNumKey &&
(event.ctrlKey || event.altKey || event.metaKey) || (event.ctrlKey || event.altKey || event.metaKey) ||
!normalKey)) { !normalKey)) {

View file

@ -355,7 +355,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
}; };
ShellInABox.prototype.about = function() { 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" + "\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com" + "For more information check http://shellinabox.com" +
(typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ? (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?

View file

@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() {
}; };
VT100.prototype.about = 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" + "\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com"); "For more information check http://shellinabox.com");
}; };
@ -1840,6 +1840,20 @@ VT100.prototype.checkComposedKeys = function(event) {
}; };
VT100.prototype.fixEvent = 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 // 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.
@ -1939,7 +1953,11 @@ VT100.prototype.keyDown = function(event) {
// In fact, we see them, but we cannot stop IE from seeing them, too. // In fact, we see them, but we cannot stop IE from seeing them, too.
if ((event.charCode || event.keyCode) && if ((event.charCode || event.keyCode) &&
((alphNumKey && (event.ctrlKey || event.altKey || event.metaKey) && ((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 && this.catchModifiersEarly && normalKey && !alphNumKey &&
(event.ctrlKey || event.altKey || event.metaKey) || (event.ctrlKey || event.altKey || event.metaKey) ||
!normalKey)) { !normalKey)) {

View file

@ -1840,6 +1840,20 @@ VT100.prototype.checkComposedKeys = function(event) {
}; };
VT100.prototype.fixEvent = 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 // 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.
@ -1939,7 +1953,11 @@ VT100.prototype.keyDown = function(event) {
// In fact, we see them, but we cannot stop IE from seeing them, too. // In fact, we see them, but we cannot stop IE from seeing them, too.
if ((event.charCode || event.keyCode) && if ((event.charCode || event.keyCode) &&
((alphNumKey && (event.ctrlKey || event.altKey || event.metaKey) && ((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 && this.catchModifiersEarly && normalKey && !alphNumKey &&
(event.ctrlKey || event.altKey || event.metaKey) || (event.ctrlKey || event.altKey || event.metaKey) ||
!normalKey)) { !normalKey)) {