diff options
| author | Richard M. Stallman | 1996-05-10 20:33:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-05-10 20:33:26 +0000 |
| commit | b6823b27409c2fe7802a86ec100ef2094e93dfe0 (patch) | |
| tree | b080683d11b83493b950c73ec2867c21ff3bacd8 /src/w32console.c | |
| parent | 05687c547ba8988521e0355a5d81e18f48c2eebf (diff) | |
| download | emacs-b6823b27409c2fe7802a86ec100ef2094e93dfe0.tar.gz emacs-b6823b27409c2fe7802a86ec100ef2094e93dfe0.zip | |
(prev_console_mode): New variable.
(unset_kbd): Use prev_console_mode.
(reset_kbd): Set prev_console_mode. Call Fset_input_mode.
Diffstat (limited to 'src/w32console.c')
| -rw-r--r-- | src/w32console.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/w32console.c b/src/w32console.c index 31ec9363569..67886590714 100644 --- a/src/w32console.c +++ b/src/w32console.c | |||
| @@ -80,6 +80,7 @@ COORD cursor_coords; | |||
| 80 | HANDLE prev_screen, cur_screen; | 80 | HANDLE prev_screen, cur_screen; |
| 81 | UCHAR char_attr, char_attr_normal, char_attr_reverse; | 81 | UCHAR char_attr, char_attr_normal, char_attr_reverse; |
| 82 | HANDLE keyboard_handle; | 82 | HANDLE keyboard_handle; |
| 83 | DWORD prev_console_mode; | ||
| 83 | 84 | ||
| 84 | 85 | ||
| 85 | /* Setting this as the ctrl handler prevents emacs from being killed when | 86 | /* Setting this as the ctrl handler prevents emacs from being killed when |
| @@ -521,15 +522,18 @@ set_terminal_window (int size) | |||
| 521 | void | 522 | void |
| 522 | unset_kbd (void) | 523 | unset_kbd (void) |
| 523 | { | 524 | { |
| 524 | SetConsoleMode (keyboard_handle, ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | | 525 | SetConsoleMode (keyboard_handle, prev_console_mode); |
| 525 | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT); | ||
| 526 | } | 526 | } |
| 527 | 527 | ||
| 528 | void | 528 | void |
| 529 | reset_kbd (void) | 529 | reset_kbd (void) |
| 530 | { | 530 | { |
| 531 | keyboard_handle = GetStdHandle (STD_INPUT_HANDLE); | 531 | keyboard_handle = GetStdHandle (STD_INPUT_HANDLE); |
| 532 | GetConsoleMode (keyboard_handle, &prev_console_mode); | ||
| 532 | SetConsoleMode (keyboard_handle, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); | 533 | SetConsoleMode (keyboard_handle, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); |
| 534 | |||
| 535 | /* Try to use interrupt input; if we can't, then start polling. */ | ||
| 536 | Fset_input_mode (Qt, Qnil, Qt, Qnil); | ||
| 533 | } | 537 | } |
| 534 | 538 | ||
| 535 | typedef int (*term_hook) (); | 539 | typedef int (*term_hook) (); |