changeset 16763:e4f0f7fe8304

(dos_set_keyboard): Test whether KEYB.COM is installed for international keyboard support. (dos_get_modifiers): If international keyboard support is NOT required, make both Right and Left Alt key behave like Meta key.
author Richard M. Stallman <rms@gnu.org>
date Fri, 27 Dec 1996 02:11:22 +0000
parents 9b9acdb0e3d7
children 2aa0fbda89a9
files src/msdos.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/msdos.c	Fri Dec 27 02:06:41 1996 +0000
+++ b/src/msdos.c	Fri Dec 27 02:11:22 1996 +0000
@@ -1137,6 +1137,7 @@
 
 static struct dos_keyboard_map *keyboard;
 static int keyboard_map_all;
+static int international_keyboard;
 
 int
 dos_set_keyboard (code, always)
@@ -1144,6 +1145,13 @@
      int always;
 {
   int i;
+  union REGS regs;
+
+  /* See if Keyb.Com is installed (for international keyboard support).  */
+  regs.x.ax = 0xad80;
+  int86 (0x2f, &regs, &regs);
+  if (regs.h.al == 0xff)
+    international_keyboard = 1;
 
   /* Initialize to US settings, for countries that don't have their own.  */
   keyboard = keyboard_layout_list[0].keyboard_map;
@@ -1451,6 +1459,13 @@
 	      mask |= SUPER_P;
 	      modifiers |= super_modifier;
 	    }
+	  else if (!international_keyboard)
+	    {
+	      /* If Keyb.Com is NOT installed, let Right Alt behave
+		 like the Left Alt.  */
+	      mask &= ~ALT_GR_P;
+	      mask |= ALT_P;
+	    }
 	}
       
       if (regs.h.ah & 1)		/* Left CTRL pressed ? */