1 /* Input event support for Emacs on the Microsoft Windows API.
2 Copyright (C) 1992-1993, 1995, 2001-2012 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 Adapted from ntkbd.c by Tim Fleehart
37 #include "dispextern.h"
39 #include "blockinput.h"
40 #include "termhooks.h"
46 /* stdin, from w32console.c */
47 extern HANDLE keyboard_handle
;
49 /* Info for last mouse motion */
50 static COORD movement_pos
;
51 static Time movement_time
;
54 extern unsigned int map_keypad_keys (unsigned int, unsigned int);
55 extern unsigned int w32_key_to_modifier (int key
);
58 #define EVENT_QUEUE_SIZE 50
59 static INPUT_RECORD event_queue
[EVENT_QUEUE_SIZE
];
60 static INPUT_RECORD
*queue_ptr
= event_queue
, *queue_end
= event_queue
;
62 /* Temporarily store lead byte of DBCS input sequences. */
63 static char dbcs_lead
= 0;
66 w32_read_console_input (HANDLE h
, INPUT_RECORD
*rec
, DWORD recsize
,
69 return (w32_console_unicode_input
70 ? ReadConsoleInputW (h
, rec
, recsize
, waiting
)
71 : ReadConsoleInputA (h
, rec
, recsize
, waiting
));
75 fill_queue (BOOL block
)
80 if (queue_ptr
< queue_end
)
81 return queue_end
-queue_ptr
;
85 /* Check to see if there are some events to read before we try
86 because we can't block. */
87 if (!GetNumberOfConsoleInputEvents (keyboard_handle
, &events_waiting
))
89 if (events_waiting
== 0)
93 rc
= w32_read_console_input (keyboard_handle
, event_queue
, EVENT_QUEUE_SIZE
,
97 queue_ptr
= event_queue
;
98 queue_end
= event_queue
+ events_waiting
;
99 return (int) events_waiting
;
102 /* In a generic, multi-frame world this should take a console handle
103 and return the frame for it
105 Right now, there's only one frame so return it. */
109 return SELECTED_FRAME ();
112 /* Translate console modifiers to emacs modifiers.
113 German keyboard support (Kai Morgan Zeise 2/18/95). */
115 w32_kbd_mods_to_emacs (DWORD mods
, WORD key
)
119 /* If we recognize right-alt and left-ctrl as AltGr, and it has been
120 pressed, first remove those modifiers. */
121 if (!NILP (Vw32_recognize_altgr
)
122 && (mods
& (RIGHT_ALT_PRESSED
| LEFT_CTRL_PRESSED
))
123 == (RIGHT_ALT_PRESSED
| LEFT_CTRL_PRESSED
))
124 mods
&= ~ (RIGHT_ALT_PRESSED
| LEFT_CTRL_PRESSED
);
126 if (mods
& (RIGHT_ALT_PRESSED
| LEFT_ALT_PRESSED
))
127 retval
= ((NILP (Vw32_alt_is_meta
)) ? alt_modifier
: meta_modifier
);
129 if (mods
& (RIGHT_CTRL_PRESSED
| LEFT_CTRL_PRESSED
))
131 retval
|= ctrl_modifier
;
132 if ((mods
& (RIGHT_CTRL_PRESSED
| LEFT_CTRL_PRESSED
))
133 == (RIGHT_CTRL_PRESSED
| LEFT_CTRL_PRESSED
))
134 retval
|= meta_modifier
;
137 if (mods
& LEFT_WIN_PRESSED
)
138 retval
|= w32_key_to_modifier (VK_LWIN
);
139 if (mods
& RIGHT_WIN_PRESSED
)
140 retval
|= w32_key_to_modifier (VK_RWIN
);
141 if (mods
& APPS_PRESSED
)
142 retval
|= w32_key_to_modifier (VK_APPS
);
143 if (mods
& SCROLLLOCK_ON
)
144 retval
|= w32_key_to_modifier (VK_SCROLL
);
146 /* Just in case someone wanted the original behavior, make it
147 optional by setting w32-capslock-is-shiftlock to t. */
148 if (NILP (Vw32_capslock_is_shiftlock
)
149 /* Keys that should _not_ be affected by CapsLock. */
150 && ( (key
== VK_BACK
)
153 || (key
== VK_RETURN
)
154 || (key
== VK_ESCAPE
)
155 || ((key
>= VK_SPACE
) && (key
<= VK_HELP
))
156 || ((key
>= VK_NUMPAD0
) && (key
<= VK_F24
))
157 || ((key
>= VK_NUMPAD_CLEAR
) && (key
<= VK_NUMPAD_DELETE
))
160 /* Only consider shift state. */
161 if ((mods
& SHIFT_PRESSED
) != 0)
162 retval
|= shift_modifier
;
166 /* Ignore CapsLock state if not enabled. */
167 if (NILP (Vw32_enable_caps_lock
))
168 mods
&= ~CAPSLOCK_ON
;
169 if ((mods
& (SHIFT_PRESSED
| CAPSLOCK_ON
)) != 0)
170 retval
|= shift_modifier
;
177 /* Return nonzero if the virtual key is a dead key. */
179 is_dead_key (int wparam
)
181 unsigned int code
= MapVirtualKey (wparam
, 2);
183 /* Windows 95 returns 0x8000, NT returns 0x80000000. */
184 return (code
& 0x80008000) ? 1 : 0;
188 /* The return code indicates key code size. */
190 w32_kbd_patch_key (KEY_EVENT_RECORD
*event
)
192 unsigned int key_code
= event
->wVirtualKeyCode
;
193 unsigned int mods
= event
->dwControlKeyState
;
195 static BYTE ansi_code
[4];
196 static int isdead
= 0;
200 event
->uChar
.AsciiChar
= ansi_code
[2];
204 if (event
->uChar
.AsciiChar
!= 0)
207 memset (keystate
, 0, sizeof (keystate
));
208 keystate
[key_code
] = 0x80;
209 if (mods
& SHIFT_PRESSED
)
210 keystate
[VK_SHIFT
] = 0x80;
211 if (mods
& CAPSLOCK_ON
)
212 keystate
[VK_CAPITAL
] = 1;
213 /* If we recognize right-alt and left-ctrl as AltGr, set the key
214 states accordingly before invoking ToAscii. */
215 if (!NILP (Vw32_recognize_altgr
)
216 && (mods
& LEFT_CTRL_PRESSED
) && (mods
& RIGHT_ALT_PRESSED
))
218 keystate
[VK_CONTROL
] = 0x80;
219 keystate
[VK_LCONTROL
] = 0x80;
220 keystate
[VK_MENU
] = 0x80;
221 keystate
[VK_RMENU
] = 0x80;
225 /* Because of an OS bug, ToAscii corrupts the stack when called to
226 convert a dead key in console mode on NT4. Unfortunately, trying
227 to check for dead keys using MapVirtualKey doesn't work either -
228 these functions apparently use internal information about keyboard
229 layout which doesn't get properly updated in console programs when
230 changing layout (though apparently it gets partly updated,
231 otherwise ToAscii wouldn't crash). */
232 if (is_dead_key (event
->wVirtualKeyCode
))
236 /* On NT, call ToUnicode instead and then convert to the current
237 console input codepage. */
238 if (os_subtype
== OS_NT
)
242 isdead
= ToUnicode (event
->wVirtualKeyCode
, event
->wVirtualScanCode
,
243 keystate
, buf
, 128, 0);
246 int cpId
= GetConsoleCP ();
248 event
->uChar
.UnicodeChar
= buf
[isdead
- 1];
249 isdead
= WideCharToMultiByte (cpId
, 0, buf
, isdead
,
250 ansi_code
, 4, NULL
, NULL
);
257 isdead
= ToAscii (event
->wVirtualKeyCode
, event
->wVirtualScanCode
,
258 keystate
, (LPWORD
) ansi_code
, 0);
263 event
->uChar
.AsciiChar
= ansi_code
[0];
268 static int faked_key
= 0;
270 /* return code -1 means that event_queue_ptr won't be incremented.
271 In other word, this event makes two key codes. (by himi) */
273 key_event (KEY_EVENT_RECORD
*event
, struct input_event
*emacs_ev
, int *isdead
)
275 static int mod_key_state
= 0;
280 /* Skip key-up events. */
281 if (!event
->bKeyDown
)
283 switch (event
->wVirtualKeyCode
)
286 mod_key_state
&= ~LEFT_WIN_PRESSED
;
289 mod_key_state
&= ~RIGHT_WIN_PRESSED
;
292 mod_key_state
&= ~APPS_PRESSED
;
298 /* Ignore keystrokes we fake ourself; see below. */
299 if (faked_key
== event
->wVirtualKeyCode
)
305 /* To make it easier to debug this code, ignore modifier keys! */
306 switch (event
->wVirtualKeyCode
)
309 if (NILP (Vw32_pass_lwindow_to_system
))
311 /* Prevent system from acting on keyup (which opens the Start
312 menu if no other key was pressed) by simulating a press of
313 Space which we will ignore. */
314 if ((mod_key_state
& LEFT_WIN_PRESSED
) == 0)
316 if (NUMBERP (Vw32_phantom_key_code
))
317 faked_key
= XUINT (Vw32_phantom_key_code
) & 255;
319 faked_key
= VK_SPACE
;
320 keybd_event (faked_key
, (BYTE
) MapVirtualKey (faked_key
, 0), 0, 0);
323 mod_key_state
|= LEFT_WIN_PRESSED
;
324 if (!NILP (Vw32_lwindow_modifier
))
328 if (NILP (Vw32_pass_rwindow_to_system
))
330 if ((mod_key_state
& RIGHT_WIN_PRESSED
) == 0)
332 if (NUMBERP (Vw32_phantom_key_code
))
333 faked_key
= XUINT (Vw32_phantom_key_code
) & 255;
335 faked_key
= VK_SPACE
;
336 keybd_event (faked_key
, (BYTE
) MapVirtualKey (faked_key
, 0), 0, 0);
339 mod_key_state
|= RIGHT_WIN_PRESSED
;
340 if (!NILP (Vw32_rwindow_modifier
))
344 mod_key_state
|= APPS_PRESSED
;
345 if (!NILP (Vw32_apps_modifier
))
349 /* Decide whether to treat as modifier or function key. */
350 if (NILP (Vw32_enable_caps_lock
))
351 goto disable_lock_key
;
354 /* Decide whether to treat as modifier or function key. */
355 if (NILP (Vw32_enable_num_lock
))
356 goto disable_lock_key
;
359 /* Decide whether to treat as modifier or function key. */
360 if (NILP (Vw32_scroll_lock_modifier
))
361 goto disable_lock_key
;
364 /* Ensure the appropriate lock key state is off (and the
365 indicator light as well). */
366 wParam
= event
->wVirtualKeyCode
;
367 if (GetAsyncKeyState (wParam
) & 0x8000)
369 /* Fake another press of the relevant key. Apparently, this
370 really is the only way to turn off the indicator. */
372 keybd_event ((BYTE
) wParam
, (BYTE
) MapVirtualKey (wParam
, 0),
373 KEYEVENTF_EXTENDEDKEY
| KEYEVENTF_KEYUP
, 0);
374 keybd_event ((BYTE
) wParam
, (BYTE
) MapVirtualKey (wParam
, 0),
375 KEYEVENTF_EXTENDEDKEY
| 0, 0);
376 keybd_event ((BYTE
) wParam
, (BYTE
) MapVirtualKey (wParam
, 0),
377 KEYEVENTF_EXTENDEDKEY
| KEYEVENTF_KEYUP
, 0);
385 /* Windows maps Ctrl-Pause (aka Ctrl-Break) into VK_CANCEL,
386 which is confusing for purposes of key binding; convert
387 VK_CANCEL events into VK_PAUSE events. */
388 event
->wVirtualKeyCode
= VK_PAUSE
;
391 /* Windows maps Ctrl-NumLock into VK_PAUSE, which is confusing
392 for purposes of key binding; convert these back into
393 VK_NUMLOCK events, at least when we want to see NumLock key
394 presses. (Note that there is never any possibility that
395 VK_PAUSE with Ctrl really is C-Pause as per above.) */
396 if (NILP (Vw32_enable_num_lock
)
397 && (event
->dwControlKeyState
398 & (LEFT_CTRL_PRESSED
| RIGHT_CTRL_PRESSED
)) != 0)
399 event
->wVirtualKeyCode
= VK_NUMLOCK
;
403 /* Recognize state of Windows and Apps keys. */
404 event
->dwControlKeyState
|= mod_key_state
;
406 /* Distinguish numeric keypad keys from extended keys. */
407 event
->wVirtualKeyCode
=
408 map_keypad_keys (event
->wVirtualKeyCode
,
409 (event
->dwControlKeyState
& ENHANCED_KEY
));
411 if (lispy_function_keys
[event
->wVirtualKeyCode
] == 0)
413 if (!NILP (Vw32_recognize_altgr
)
414 && (event
->dwControlKeyState
& LEFT_CTRL_PRESSED
)
415 && (event
->dwControlKeyState
& RIGHT_ALT_PRESSED
))
417 /* Don't try to interpret AltGr key chords; ToAscii seems not
418 to process them correctly. */
420 /* Handle key chords including any modifiers other than shift
421 directly, in order to preserve as much modifier information as
423 else if (event
->dwControlKeyState
424 & ( RIGHT_CTRL_PRESSED
| LEFT_CTRL_PRESSED
425 | RIGHT_ALT_PRESSED
| LEFT_ALT_PRESSED
426 | (!NILP (Vw32_lwindow_modifier
) ? LEFT_WIN_PRESSED
: 0)
427 | (!NILP (Vw32_rwindow_modifier
) ? RIGHT_WIN_PRESSED
: 0)
428 | (!NILP (Vw32_apps_modifier
) ? APPS_PRESSED
: 0)
429 | (!NILP (Vw32_scroll_lock_modifier
) ? SCROLLLOCK_ON
: 0)))
431 /* Don't translate modified alphabetic keystrokes, so the user
432 doesn't need to constantly switch layout to type control or
433 meta keystrokes when the normal layout translates
434 alphabetic characters to non-ascii characters. */
435 if ('A' <= event
->wVirtualKeyCode
&& event
->wVirtualKeyCode
<= 'Z')
437 event
->uChar
.AsciiChar
= event
->wVirtualKeyCode
;
438 if ((event
->dwControlKeyState
& SHIFT_PRESSED
) == 0)
439 event
->uChar
.AsciiChar
+= ('a' - 'A');
441 /* Try to handle unrecognized keystrokes by determining the
442 base character (ie. translating the base key plus shift
444 else if (event
->uChar
.AsciiChar
== 0)
445 w32_kbd_patch_key (event
);
448 if (event
->uChar
.AsciiChar
== 0)
450 emacs_ev
->kind
= NO_EVENT
;
453 else if (event
->uChar
.AsciiChar
> 0)
455 /* Pure ASCII characters < 128. */
456 emacs_ev
->kind
= ASCII_KEYSTROKE_EVENT
;
457 emacs_ev
->code
= event
->uChar
.AsciiChar
;
459 else if (event
->uChar
.UnicodeChar
> 0
460 && w32_console_unicode_input
)
462 /* Unicode codepoint; only valid if we are using Unicode
463 console input mode. */
464 emacs_ev
->kind
= MULTIBYTE_CHAR_KEYSTROKE_EVENT
;
465 emacs_ev
->code
= event
->uChar
.UnicodeChar
;
469 /* Fallback handling of non-ASCII characters for non-Unicode
470 versions of Windows, and for non-Unicode input on NT
471 family of Windows. Only characters in the current
472 console codepage are supported by this fallback. */
477 /* Get the current console input codepage to interpret this
478 key with. Note that the system defaults for the OEM
479 codepage could have been changed by calling SetConsoleCP
480 or w32-set-console-codepage, so using GetLocaleInfo to
481 get LOCALE_IDEFAULTCODEPAGE is not TRT here. */
482 cpId
= GetConsoleCP ();
485 dbcs
[1] = event
->uChar
.AsciiChar
;
489 if (!MultiByteToWideChar (cpId
, 0, dbcs
, 2, &code
, 1))
492 DebPrint (("Invalid DBCS sequence: %d %d\n",
494 emacs_ev
->kind
= NO_EVENT
;
497 else if (IsDBCSLeadByteEx (cpId
, dbcs
[1]))
500 emacs_ev
->kind
= NO_EVENT
;
504 if (!MultiByteToWideChar (cpId
, 0, &dbcs
[1], 1, &code
, 1))
507 DebPrint (("Invalid character: %d\n", dbcs
[1]));
508 emacs_ev
->kind
= NO_EVENT
;
511 emacs_ev
->kind
= MULTIBYTE_CHAR_KEYSTROKE_EVENT
;
512 emacs_ev
->code
= code
;
517 /* Function keys and other non-character keys. */
518 emacs_ev
->kind
= NON_ASCII_KEYSTROKE_EVENT
;
519 emacs_ev
->code
= event
->wVirtualKeyCode
;
522 XSETFRAME (emacs_ev
->frame_or_window
, get_frame ());
523 emacs_ev
->modifiers
= w32_kbd_mods_to_emacs (event
->dwControlKeyState
,
524 event
->wVirtualKeyCode
);
525 emacs_ev
->timestamp
= GetTickCount ();
530 w32_console_toggle_lock_key (int vk_code
, Lisp_Object new_state
)
532 int cur_state
= (GetKeyState (vk_code
) & 1);
535 || (NUMBERP (new_state
)
536 && ((XUINT (new_state
)) & 1) != cur_state
))
540 keybd_event ((BYTE
) vk_code
,
541 (BYTE
) MapVirtualKey (vk_code
, 0),
542 KEYEVENTF_EXTENDEDKEY
| KEYEVENTF_KEYUP
, 0);
543 keybd_event ((BYTE
) vk_code
,
544 (BYTE
) MapVirtualKey (vk_code
, 0),
545 KEYEVENTF_EXTENDEDKEY
| 0, 0);
546 keybd_event ((BYTE
) vk_code
,
547 (BYTE
) MapVirtualKey (vk_code
, 0),
548 KEYEVENTF_EXTENDEDKEY
| KEYEVENTF_KEYUP
, 0);
549 cur_state
= !cur_state
;
555 /* Mouse position hook. */
557 w32_console_mouse_position (FRAME_PTR
*f
,
559 Lisp_Object
*bar_window
,
560 enum scroll_bar_part
*part
,
572 SELECTED_FRAME ()->mouse_moved
= 0;
574 XSETINT (*x
, movement_pos
.X
);
575 XSETINT (*y
, movement_pos
.Y
);
576 *time
= movement_time
;
581 /* Remember mouse motion and notify emacs. */
583 mouse_moved_to (int x
, int y
)
585 /* If we're in the same place, ignore it. */
586 if (x
!= movement_pos
.X
|| y
!= movement_pos
.Y
)
588 SELECTED_FRAME ()->mouse_moved
= 1;
591 movement_time
= GetTickCount ();
595 /* Consoles return button bits in a strange order:
596 least significant - Leftmost button
597 next - Rightmost button
601 Assume emacs likes three button mice, so
605 Others increase from there. */
607 #define NUM_TRANSLATED_MOUSE_BUTTONS 3
608 static int emacs_button_translation
[NUM_TRANSLATED_MOUSE_BUTTONS
] =
614 do_mouse_event (MOUSE_EVENT_RECORD
*event
,
615 struct input_event
*emacs_ev
)
617 static DWORD button_state
= 0;
618 static Lisp_Object last_mouse_window
;
619 DWORD but_change
, mask
;
622 if (event
->dwEventFlags
== MOUSE_MOVED
)
624 FRAME_PTR f
= SELECTED_FRAME ();
625 Mouse_HLInfo
*hlinfo
= MOUSE_HL_INFO (f
);
626 int mx
= event
->dwMousePosition
.X
, my
= event
->dwMousePosition
.Y
;
628 mouse_moved_to (mx
, my
);
632 if (hlinfo
->mouse_face_hidden
)
634 hlinfo
->mouse_face_hidden
= 0;
635 clear_mouse_face (hlinfo
);
638 /* Generate SELECT_WINDOW_EVENTs when needed. */
639 if (!NILP (Vmouse_autoselect_window
))
641 Lisp_Object mouse_window
= window_from_coordinates (f
, mx
, my
,
643 /* A window will be selected only when it is not
644 selected now, and the last mouse movement event was
645 not in it. A minibuffer window will be selected iff
647 if (WINDOWP (mouse_window
)
648 && !EQ (mouse_window
, last_mouse_window
)
649 && !EQ (mouse_window
, selected_window
))
651 struct input_event event
;
654 event
.kind
= SELECT_WINDOW_EVENT
;
655 event
.frame_or_window
= mouse_window
;
657 event
.timestamp
= movement_time
;
658 kbd_buffer_store_event (&event
);
660 last_mouse_window
= mouse_window
;
663 last_mouse_window
= Qnil
;
665 previous_help_echo_string
= help_echo_string
;
666 help_echo_string
= help_echo_object
= help_echo_window
= Qnil
;
668 note_mouse_highlight (f
, mx
, my
);
669 /* If the contents of the global variable help_echo has
670 changed (inside note_mouse_highlight), generate a HELP_EVENT. */
671 if (!NILP (help_echo_string
) || !NILP (previous_help_echo_string
))
672 gen_help_event (help_echo_string
, selected_frame
, help_echo_window
,
673 help_echo_object
, help_echo_pos
);
678 /* It looks like the console code sends us a mouse event with
679 dwButtonState == 0 when a window is activated. Ignore this case. */
680 if (event
->dwButtonState
== button_state
)
683 emacs_ev
->kind
= MOUSE_CLICK_EVENT
;
685 /* Find out what button has changed state since the last button event. */
686 but_change
= button_state
^ event
->dwButtonState
;
688 for (i
= 0; mask
; i
++, mask
<<= 1)
689 if (but_change
& mask
)
691 if (i
< NUM_TRANSLATED_MOUSE_BUTTONS
)
692 emacs_ev
->code
= emacs_button_translation
[i
];
698 button_state
= event
->dwButtonState
;
699 emacs_ev
->timestamp
= GetTickCount ();
700 emacs_ev
->modifiers
= w32_kbd_mods_to_emacs (event
->dwControlKeyState
, 0) |
701 ((event
->dwButtonState
& mask
) ? down_modifier
: up_modifier
);
703 XSETFASTINT (emacs_ev
->x
, event
->dwMousePosition
.X
);
704 XSETFASTINT (emacs_ev
->y
, event
->dwMousePosition
.Y
);
705 /* for Mule 2.2 (Based on Emacs 19.28 */
707 XSET (emacs_ev
->frame_or_window
, Lisp_Frame
, get_frame ());
709 XSETFRAME (emacs_ev
->frame_or_window
, get_frame ());
716 resize_event (WINDOW_BUFFER_SIZE_RECORD
*event
)
718 FRAME_PTR f
= get_frame ();
720 change_frame_size (f
, event
->dwSize
.Y
, event
->dwSize
.X
, 0, 1, 0);
721 SET_FRAME_GARBAGED (f
);
725 maybe_generate_resize_event (void)
727 CONSOLE_SCREEN_BUFFER_INFO info
;
728 FRAME_PTR f
= get_frame ();
730 GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE
), &info
);
732 /* It is okay to call this unconditionally, since it will do nothing
733 if the size hasn't actually changed. */
734 change_frame_size (f
,
735 1 + info
.srWindow
.Bottom
- info
.srWindow
.Top
,
736 1 + info
.srWindow
.Right
- info
.srWindow
.Left
,
741 w32_console_read_socket (struct terminal
*terminal
,
743 struct input_event
*hold_quit
)
745 int nev
, ret
= 0, add
;
748 if (interrupt_input_blocked
)
750 interrupt_input_pending
= 1;
754 interrupt_input_pending
= 0;
759 nev
= fill_queue (0);
762 /* If nev == -1, there was some kind of error
763 If nev == 0 then waitp must be zero and no events were available
771 struct input_event inev
;
774 inev
.kind
= NO_EVENT
;
777 switch (queue_ptr
->EventType
)
780 add
= key_event (&queue_ptr
->Event
.KeyEvent
, &inev
, &isdead
);
781 if (add
== -1) /* 95.7.25 by himi */
787 kbd_buffer_store_event_hold (&inev
, hold_quit
);
791 add
= do_mouse_event (&queue_ptr
->Event
.MouseEvent
, &inev
);
793 kbd_buffer_store_event_hold (&inev
, hold_quit
);
796 case WINDOW_BUFFER_SIZE_EVENT
:
797 if (w32_use_full_screen_buffer
)
798 resize_event (&queue_ptr
->Event
.WindowBufferSizeEvent
);
803 /* Internal event types, ignored. */
811 if (ret
> 0 || expected
== 0)
815 /* We don't get told about changes in the window size (only the buffer
816 size, which we no longer care about), so we have to check it
818 if (!w32_use_full_screen_buffer
)
819 maybe_generate_resize_event ();