diff options
| author | Richard M. Stallman | 1995-10-26 19:06:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-10-26 19:06:38 +0000 |
| commit | 3635be47bdc67ae98851c030656339b31d7ba660 (patch) | |
| tree | 2bfd529fe7793a88381e34840af2cb102a938f45 /src | |
| parent | 85aa52faa34b3b7783b1c5d8801e6c9465450fbc (diff) | |
| download | emacs-3635be47bdc67ae98851c030656339b31d7ba660.tar.gz emacs-3635be47bdc67ae98851c030656339b31d7ba660.zip | |
(IT_ring_bell): Use intdos, not write.
(recent_doskeys_index, total_doskeys, recent_doskeys): New variables.
(Frecent_doskeys): New function.
(syms_of_msdos): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/msdos.c | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/src/msdos.c b/src/msdos.c index 16632b6b0ca..3557dee874a 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -358,7 +358,12 @@ IT_ring_bell () | |||
| 358 | ScreenVisualBell (); | 358 | ScreenVisualBell (); |
| 359 | } | 359 | } |
| 360 | else | 360 | else |
| 361 | write (1, "\007", 1); | 361 | { |
| 362 | union REGS inregs, outregs; | ||
| 363 | inregs.h.ah = 2; | ||
| 364 | inregs.h.dl = 7; | ||
| 365 | intdos (&inregs, &outregs); | ||
| 366 | } | ||
| 362 | } | 367 | } |
| 363 | 368 | ||
| 364 | static void | 369 | static void |
| @@ -1132,6 +1137,35 @@ dos_get_modifiers (keymask) | |||
| 1132 | return modifiers; | 1137 | return modifiers; |
| 1133 | } | 1138 | } |
| 1134 | 1139 | ||
| 1140 | #define NUM_RECENT_DOSKEYS (100) | ||
| 1141 | int recent_doskeys_index; /* Index for storing next element into recent_doskeys */ | ||
| 1142 | int total_doskeys; /* Total number of elements stored into recent_doskeys */ | ||
| 1143 | Lisp_Object recent_doskeys; /* A vector, holding the last 100 keystrokes */ | ||
| 1144 | |||
| 1145 | DEFUN ("recent-doskeys", Frecent_doskeys, Srecent_doskeys, 0, 0, 0, | ||
| 1146 | "Return vector of last 100 keyboard input values seen in dos_rawgetc.\n\ | ||
| 1147 | Each input key receives two values in this vector: first the ASCII code,\n\ | ||
| 1148 | and then the scan code.") | ||
| 1149 | () | ||
| 1150 | { | ||
| 1151 | Lisp_Object *keys = XVECTOR (recent_doskeys)->contents; | ||
| 1152 | Lisp_Object val; | ||
| 1153 | |||
| 1154 | if (total_doskeys < NUM_RECENT_DOSKEYS) | ||
| 1155 | return Fvector (total_doskeys, keys); | ||
| 1156 | else | ||
| 1157 | { | ||
| 1158 | val = Fvector (NUM_RECENT_DOSKEYS, keys); | ||
| 1159 | bcopy (keys + recent_doskeys_index, | ||
| 1160 | XVECTOR (val)->contents, | ||
| 1161 | (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object)); | ||
| 1162 | bcopy (keys, | ||
| 1163 | XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index, | ||
| 1164 | recent_doskeys_index * sizeof (Lisp_Object)); | ||
| 1165 | return val; | ||
| 1166 | } | ||
| 1167 | } | ||
| 1168 | |||
| 1135 | /* Get a char from keyboard. Function keys are put into the event queue. */ | 1169 | /* Get a char from keyboard. Function keys are put into the event queue. */ |
| 1136 | static int | 1170 | static int |
| 1137 | dos_rawgetc () | 1171 | dos_rawgetc () |
| @@ -1160,6 +1194,16 @@ dos_rawgetc () | |||
| 1160 | c = regs.h.al; | 1194 | c = regs.h.al; |
| 1161 | sc = regs.h.ah; | 1195 | sc = regs.h.ah; |
| 1162 | 1196 | ||
| 1197 | total_doskeys += 2; | ||
| 1198 | XVECTOR (recent_doskeys)->contents[recent_doskeys_index++] | ||
| 1199 | = make_number (c); | ||
| 1200 | if (recent_doskeys_index == NUM_RECENT_DOSKEYS) | ||
| 1201 | recent_doskeys_index = 0; | ||
| 1202 | XVECTOR (recent_doskeys)->contents[recent_doskeys_index++] | ||
| 1203 | = make_number (sc); | ||
| 1204 | if (recent_doskeys_index == NUM_RECENT_DOSKEYS) | ||
| 1205 | recent_doskeys_index = 0; | ||
| 1206 | |||
| 1163 | modifiers = dos_get_modifiers (&mask); | 1207 | modifiers = dos_get_modifiers (&mask); |
| 1164 | 1208 | ||
| 1165 | #ifndef HAVE_X_WINDOWS | 1209 | #ifndef HAVE_X_WINDOWS |
| @@ -1372,9 +1416,7 @@ dos_keyread () | |||
| 1372 | else | 1416 | else |
| 1373 | return dos_rawgetc (); | 1417 | return dos_rawgetc (); |
| 1374 | } | 1418 | } |
| 1375 | 1419 | ||
| 1376 | |||
| 1377 | |||
| 1378 | #ifndef HAVE_X_WINDOWS | 1420 | #ifndef HAVE_X_WINDOWS |
| 1379 | /* See xterm.c for more info. */ | 1421 | /* See xterm.c for more info. */ |
| 1380 | void | 1422 | void |
| @@ -2477,4 +2519,12 @@ dos_abort (file, line) | |||
| 2477 | } | 2519 | } |
| 2478 | #endif | 2520 | #endif |
| 2479 | 2521 | ||
| 2522 | syms_of_msdos () | ||
| 2523 | { | ||
| 2524 | recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil); | ||
| 2525 | staticpro (&recent_doskeys); | ||
| 2526 | |||
| 2527 | defsubr (&Srecent_doskeys); | ||
| 2528 | } | ||
| 2529 | |||
| 2480 | #endif /* MSDOS */ | 2530 | #endif /* MSDOS */ |