diff options
| -rw-r--r-- | src/msdos.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/msdos.c b/src/msdos.c index cf064306cec..16632b6b0ca 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -565,7 +565,7 @@ static | |||
| 565 | IT_reset_terminal_modes (void) | 565 | IT_reset_terminal_modes (void) |
| 566 | { | 566 | { |
| 567 | if (termscript) | 567 | if (termscript) |
| 568 | fprintf(termscript, "\n<RESET_TERM>"); | 568 | fprintf (termscript, "\n<RESET_TERM>"); |
| 569 | 569 | ||
| 570 | highlight = 0; | 570 | highlight = 0; |
| 571 | 571 | ||
| @@ -665,7 +665,7 @@ internal_terminal_init () | |||
| 665 | = (!noninteractive) && term && !strcmp (term, "internal"); | 665 | = (!noninteractive) && term && !strcmp (term, "internal"); |
| 666 | 666 | ||
| 667 | if (getenv ("EMACSTEST")) | 667 | if (getenv ("EMACSTEST")) |
| 668 | termscript = fopen(getenv ("EMACSTEST"), "wt"); | 668 | termscript = fopen (getenv ("EMACSTEST"), "wt"); |
| 669 | 669 | ||
| 670 | #ifndef HAVE_X_WINDOWS | 670 | #ifndef HAVE_X_WINDOWS |
| 671 | if (!internal_terminal || inhibit_window_system) | 671 | if (!internal_terminal || inhibit_window_system) |
| @@ -680,7 +680,7 @@ internal_terminal_init () | |||
| 680 | bzero (&the_only_x_display, sizeof the_only_x_display); | 680 | bzero (&the_only_x_display, sizeof the_only_x_display); |
| 681 | the_only_x_display.background_pixel = 7; /* White */ | 681 | the_only_x_display.background_pixel = 7; /* White */ |
| 682 | the_only_x_display.foreground_pixel = 0; /* Black */ | 682 | the_only_x_display.foreground_pixel = 0; /* Black */ |
| 683 | colors = getenv("EMACSCOLORS"); | 683 | colors = getenv ("EMACSCOLORS"); |
| 684 | if (colors && strlen (colors) >= 2) | 684 | if (colors && strlen (colors) >= 2) |
| 685 | { | 685 | { |
| 686 | the_only_x_display.foreground_pixel = colors[0] & 0x07; | 686 | the_only_x_display.foreground_pixel = colors[0] & 0x07; |
| @@ -726,6 +726,7 @@ dos_get_saved_screen (screen, rows, cols) | |||
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | 728 | ||
| 729 | |||
| 729 | /* ----------------------- Keyboard control ---------------------- | 730 | /* ----------------------- Keyboard control ---------------------- |
| 730 | * | 731 | * |
| 731 | * Keymaps reflect the following keyboard layout: | 732 | * Keymaps reflect the following keyboard layout: |
| @@ -780,10 +781,11 @@ static struct keyboard_layout_list | |||
| 780 | { | 781 | { |
| 781 | int country_code; | 782 | int country_code; |
| 782 | struct dos_keyboard_map *keyboard_map; | 783 | struct dos_keyboard_map *keyboard_map; |
| 783 | } keyboard_layout_list[] = { | 784 | } keyboard_layout_list[] = |
| 784 | 1, &us_keyboard, | 785 | { |
| 785 | 33, &fr_keyboard, | 786 | 1, &us_keyboard, |
| 786 | 45, &dk_keyboard | 787 | 33, &fr_keyboard, |
| 788 | 45, &dk_keyboard | ||
| 787 | }; | 789 | }; |
| 788 | 790 | ||
| 789 | static struct dos_keyboard_map *keyboard; | 791 | static struct dos_keyboard_map *keyboard; |
| @@ -805,7 +807,7 @@ dos_set_keyboard (code, always) | |||
| 805 | } | 807 | } |
| 806 | return 0; | 808 | return 0; |
| 807 | } | 809 | } |
| 808 | 810 | ||
| 809 | #define Ignore 0x0000 | 811 | #define Ignore 0x0000 |
| 810 | #define Normal 0x0000 /* normal key - alt changes scan-code */ | 812 | #define Normal 0x0000 /* normal key - alt changes scan-code */ |
| 811 | #define FctKey 0x1000 /* func key if c == 0, else c */ | 813 | #define FctKey 0x1000 /* func key if c == 0, else c */ |
| @@ -1043,7 +1045,7 @@ ibmpc_translate_map[] = | |||
| 1043 | Alt | FctKey | 0x09, /* (Alt) Tab */ | 1045 | Alt | FctKey | 0x09, /* (Alt) Tab */ |
| 1044 | Alt | Grey | 4 /* (Alt) Keypad Enter */ | 1046 | Alt | Grey | 4 /* (Alt) Keypad Enter */ |
| 1045 | }; | 1047 | }; |
| 1046 | 1048 | ||
| 1047 | /* These bit-positions corresponds to values returned by BIOS */ | 1049 | /* These bit-positions corresponds to values returned by BIOS */ |
| 1048 | #define SHIFT_P 0x0003 /* two bits! */ | 1050 | #define SHIFT_P 0x0003 /* two bits! */ |
| 1049 | #define CTRL_P 0x0004 | 1051 | #define CTRL_P 0x0004 |
| @@ -1138,7 +1140,7 @@ dos_rawgetc () | |||
| 1138 | union REGS regs; | 1140 | union REGS regs; |
| 1139 | 1141 | ||
| 1140 | #ifndef HAVE_X_WINDOWS | 1142 | #ifndef HAVE_X_WINDOWS |
| 1141 | SCREEN_SET_CURSOR(); | 1143 | SCREEN_SET_CURSOR (); |
| 1142 | if (!mouse_visible) mouse_on (); | 1144 | if (!mouse_visible) mouse_on (); |
| 1143 | #endif | 1145 | #endif |
| 1144 | 1146 | ||
| @@ -1158,10 +1160,10 @@ dos_rawgetc () | |||
| 1158 | c = regs.h.al; | 1160 | c = regs.h.al; |
| 1159 | sc = regs.h.ah; | 1161 | sc = regs.h.ah; |
| 1160 | 1162 | ||
| 1161 | modifiers = dos_get_modifiers( &mask ); | 1163 | modifiers = dos_get_modifiers (&mask); |
| 1162 | 1164 | ||
| 1163 | #ifndef HAVE_X_WINDOWS | 1165 | #ifndef HAVE_X_WINDOWS |
| 1164 | if (!NILP(Vdos_display_scancodes)) | 1166 | if (!NILP (Vdos_display_scancodes)) |
| 1165 | { | 1167 | { |
| 1166 | char buf[10]; | 1168 | char buf[10]; |
| 1167 | sprintf (buf, "%02x:%02x*%04x", | 1169 | sprintf (buf, "%02x:%02x*%04x", |
| @@ -1247,15 +1249,15 @@ dos_rawgetc () | |||
| 1247 | 1249 | ||
| 1248 | if (mask & SHIFT_P) | 1250 | if (mask & SHIFT_P) |
| 1249 | { | 1251 | { |
| 1250 | code = keyboard->shifted[ code ]; | 1252 | code = keyboard->shifted[code]; |
| 1251 | mask -= SHIFT_P; | 1253 | mask -= SHIFT_P; |
| 1252 | modifiers &= ~shift_modifier; | 1254 | modifiers &= ~shift_modifier; |
| 1253 | } | 1255 | } |
| 1254 | else | 1256 | else |
| 1255 | if ((mask & ALT_GR_P) && keyboard->alt_gr && keyboard->alt_gr[ code ] != ' ') | 1257 | if ((mask & ALT_GR_P) && keyboard->alt_gr && keyboard->alt_gr[code] != ' ') |
| 1256 | code = keyboard->alt_gr[ code ]; | 1258 | code = keyboard->alt_gr[code]; |
| 1257 | else | 1259 | else |
| 1258 | code = keyboard->unshifted[ code ]; | 1260 | code = keyboard->unshifted[code]; |
| 1259 | break; | 1261 | break; |
| 1260 | 1262 | ||
| 1261 | case KeyPad: | 1263 | case KeyPad: |
| @@ -1273,19 +1275,19 @@ dos_rawgetc () | |||
| 1273 | case 0: | 1275 | case 0: |
| 1274 | if (code == 10 && dos_decimal_point) | 1276 | if (code == 10 && dos_decimal_point) |
| 1275 | return dos_decimal_point; | 1277 | return dos_decimal_point; |
| 1276 | return keypad_translate_map[ code ].char_code; | 1278 | return keypad_translate_map[code].char_code; |
| 1277 | 1279 | ||
| 1278 | case 1: | 1280 | case 1: |
| 1279 | code = 0xff00 | keypad_translate_map[ code ].keypad_code; | 1281 | code = 0xff00 | keypad_translate_map[code].keypad_code; |
| 1280 | break; | 1282 | break; |
| 1281 | 1283 | ||
| 1282 | case 2: | 1284 | case 2: |
| 1283 | code = keypad_translate_map[ code ].meta_code; | 1285 | code = keypad_translate_map[code].meta_code; |
| 1284 | modifiers = meta_modifier; | 1286 | modifiers = meta_modifier; |
| 1285 | break; | 1287 | break; |
| 1286 | 1288 | ||
| 1287 | case 3: | 1289 | case 3: |
| 1288 | code = 0xff00 | keypad_translate_map[ code ].editkey_code; | 1290 | code = 0xff00 | keypad_translate_map[code].editkey_code; |
| 1289 | break; | 1291 | break; |
| 1290 | } | 1292 | } |
| 1291 | break; | 1293 | break; |
| @@ -1294,9 +1296,9 @@ dos_rawgetc () | |||
| 1294 | code &= 0xff; | 1296 | code &= 0xff; |
| 1295 | kp_mode = ((mask & (NUMLOCK_P|CTRL_P|SHIFT_P|ALT_P)) == NUMLOCK_P) ? 0x04 : 0x40; | 1297 | kp_mode = ((mask & (NUMLOCK_P|CTRL_P|SHIFT_P|ALT_P)) == NUMLOCK_P) ? 0x04 : 0x40; |
| 1296 | if (dos_keypad_mode & kp_mode) | 1298 | if (dos_keypad_mode & kp_mode) |
| 1297 | code = 0xff00 | grey_key_translate_map[ code ].keypad_code; | 1299 | code = 0xff00 | grey_key_translate_map[code].keypad_code; |
| 1298 | else | 1300 | else |
| 1299 | code = grey_key_translate_map[ code ].char_code; | 1301 | code = grey_key_translate_map[code].char_code; |
| 1300 | break; | 1302 | break; |
| 1301 | } | 1303 | } |
| 1302 | 1304 | ||
| @@ -1925,7 +1927,7 @@ init_environment (argc, argv, skip_args) | |||
| 1925 | /* Time zone determined from country code. To make this possible, the | 1927 | /* Time zone determined from country code. To make this possible, the |
| 1926 | country code may not span more than one time zone. In other words, | 1928 | country code may not span more than one time zone. In other words, |
| 1927 | in the USA, you lose. */ | 1929 | in the USA, you lose. */ |
| 1928 | if (!getenv("TZ")) | 1930 | if (!getenv ("TZ")) |
| 1929 | switch (dos_country_code) | 1931 | switch (dos_country_code) |
| 1930 | { | 1932 | { |
| 1931 | case 31: /* Belgium */ | 1933 | case 31: /* Belgium */ |
| @@ -2182,7 +2184,7 @@ run_msdos_command (argv, dir, tempin, tempout) | |||
| 2182 | close (outbak); | 2184 | close (outbak); |
| 2183 | close (errbak); | 2185 | close (errbak); |
| 2184 | 2186 | ||
| 2185 | dos_ttraw(); | 2187 | dos_ttraw (); |
| 2186 | if (have_mouse > 0) | 2188 | if (have_mouse > 0) |
| 2187 | { | 2189 | { |
| 2188 | mouse_init (); | 2190 | mouse_init (); |