diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-05-10 20:33:26 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-05-10 20:33:26 +0000 |
commit | df68c84bd188e8eaeaa83cc73c577a00ac9f2103 (patch) | |
tree | 0e428ae2eb8c8ab8d3675ad0fcb42bd75aa66c42 /src/w32console.c | |
parent | bf8a543e552597073ad3026fd86cbb415d9c82a4 (diff) | |
download | emacs-df68c84bd188e8eaeaa83cc73c577a00ac9f2103.tar.gz |
(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; HANDLE prev_screen, cur_screen; UCHAR char_attr, char_attr_normal, char_attr_reverse; HANDLE keyboard_handle; +DWORD prev_console_mode; /* Setting this as the ctrl handler prevents emacs from being killed when @@ -521,15 +522,18 @@ set_terminal_window (int size) void unset_kbd (void) { - SetConsoleMode (keyboard_handle, ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | - ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT); + SetConsoleMode (keyboard_handle, prev_console_mode); } void reset_kbd (void) { keyboard_handle = GetStdHandle (STD_INPUT_HANDLE); + GetConsoleMode (keyboard_handle, &prev_console_mode); SetConsoleMode (keyboard_handle, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); + + /* Try to use interrupt input; if we can't, then start polling. */ + Fset_input_mode (Qt, Qnil, Qt, Qnil); } typedef int (*term_hook) (); |