Mercurial > emacs
annotate src/w32inevt.c @ 14358:55e1bf4d743a
(iso-languages): Restructure the list to remove
redundancy in list elements.
(iso-accents-compose-key): Function deleted.
(iso-accents-compose, iso-accents-customize, iso-accentuate,
iso-accent-rassoc-unit, iso-unaccentuate, iso-deaccentuate):
Adapt for new structure of `iso-languages'.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 25 Jan 1996 06:34:56 +0000 |
parents | 59d24d42958a |
children | 24e5bd545f4d |
rev | line source |
---|---|
9907 | 1 /* Input event support for Windows NT port of GNU Emacs. |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
2 Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. |
9907 | 3 |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
4 This file is part of GNU Emacs. |
9907 | 5 |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
6 GNU Emacs is free software; you can redistribute it and/or modify |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
7 it under the terms of the GNU General Public License as published by |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
8 the Free Software Foundation; either version 2, or (at your option) |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
9 any later version. |
9907 | 10 |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
11 GNU Emacs is distributed in the hope that it will be useful, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
14 GNU General Public License for more details. |
9907 | 15 |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
16 You should have received a copy of the GNU General Public License |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
17 along with GNU Emacs; see the file COPYING. If not, write to |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
12544
diff
changeset
|
19 Boston, MA 02111-1307, USA. |
9907 | 20 |
21 Drew Bliss 01-Oct-93 | |
22 Adapted from ntkbd.c by Tim Fleehart | |
23 */ | |
24 | |
25 | |
26 #include "config.h" | |
27 | |
28 #include <stdlib.h> | |
29 #include <stdio.h> | |
30 #include <windows.h> | |
31 | |
32 #include "lisp.h" | |
33 #include "frame.h" | |
34 #include "blockinput.h" | |
35 #include "termhooks.h" | |
36 | |
37 /* stdin, from ntterm */ | |
38 extern HANDLE keyboard_handle; | |
39 | |
40 /* Info for last mouse motion */ | |
41 static COORD movement_pos; | |
42 static DWORD movement_time; | |
43 | |
44 /* from keyboard.c */ | |
45 extern void reinvoke_input_signal (void); | |
46 | |
47 /* from dispnew.c */ | |
48 extern int change_frame_size (FRAME_PTR, int, int, int, int); | |
49 | |
50 /* Event queue */ | |
51 #define EVENT_QUEUE_SIZE 50 | |
52 static INPUT_RECORD event_queue[EVENT_QUEUE_SIZE]; | |
53 static INPUT_RECORD *queue_ptr = event_queue, *queue_end = event_queue; | |
54 | |
55 static int | |
56 fill_queue (BOOL block) | |
57 { | |
58 BOOL rc; | |
59 DWORD events_waiting; | |
60 | |
61 if (queue_ptr < queue_end) | |
62 return queue_end-queue_ptr; | |
63 | |
64 if (!block) | |
65 { | |
66 /* Check to see if there are some events to read before we try | |
67 because we can't block. */ | |
68 if (!GetNumberOfConsoleInputEvents (keyboard_handle, &events_waiting)) | |
69 return -1; | |
70 if (events_waiting == 0) | |
71 return 0; | |
72 } | |
73 | |
74 rc = ReadConsoleInput (keyboard_handle, event_queue, EVENT_QUEUE_SIZE, | |
75 &events_waiting); | |
76 if (!rc) | |
77 return -1; | |
78 queue_ptr = event_queue; | |
79 queue_end = event_queue + events_waiting; | |
80 return (int) events_waiting; | |
81 } | |
82 | |
83 /* In a generic, multi-frame world this should take a console handle | |
84 and return the frame for it | |
85 | |
86 Right now, there's only one frame so return it. */ | |
87 static FRAME_PTR | |
88 get_frame (void) | |
89 { | |
90 return selected_frame; | |
91 } | |
92 | |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
93 /* Translate console modifiers to emacs modifiers. |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
94 German keyboard support (Kai Morgan Zeise 2/18/95). */ |
9907 | 95 static int |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
96 win32_kbd_mods_to_emacs (DWORD mods) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
97 { |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
98 int retval = 0; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
99 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
100 /* If AltGr has been pressed, remove it. */ |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
101 if ((mods & (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED)) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
102 == (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED)) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
103 mods &= ~ (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED); |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
104 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
105 if (mods & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED)) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
106 retval = meta_modifier; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
107 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
108 if (mods & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
109 { |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
110 retval |= ctrl_modifier; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
111 if ((mods & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
112 == (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
113 retval |= meta_modifier; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
114 } |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
115 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
116 if (((mods & (SHIFT_PRESSED | CAPSLOCK_ON)) == SHIFT_PRESSED) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
117 || ((mods & (SHIFT_PRESSED | CAPSLOCK_ON)) == CAPSLOCK_ON)) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
118 retval |= shift_modifier; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
119 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
120 return retval; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
121 } |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
122 |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
123 /* The return code indicates key code size. */ |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
124 static int |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
125 win32_kbd_patch_key (KEY_EVENT_RECORD *event) |
9907 | 126 { |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
127 unsigned int key_code = event->wVirtualKeyCode; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
128 unsigned int mods = event->dwControlKeyState; |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
129 BYTE keystate[256]; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
130 static BYTE ansi_code[4]; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
131 static int isdead; |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
132 |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
133 if (isdead == 2) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
134 { |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
135 event->uChar.AsciiChar = ansi_code[2]; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
136 isdead = 0; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
137 return 1; |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
138 } |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
139 if (event->uChar.AsciiChar != 0) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
140 return 1; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
141 memset (keystate, 0, sizeof (keystate)); |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
142 if (mods & SHIFT_PRESSED) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
143 keystate[VK_SHIFT] = 0x80; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
144 if (mods & CAPSLOCK_ON) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
145 keystate[VK_CAPITAL] = 1; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
146 isdead = ToAscii (event->wVirtualKeyCode, event->wVirtualScanCode, |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
147 keystate, (LPWORD) ansi_code, 0); |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
148 if (isdead == 0) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
149 return 0; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
150 event->uChar.AsciiChar = ansi_code[0]; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
151 return isdead; |
9907 | 152 } |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
153 |
9907 | 154 /* Map virtual key codes into: |
155 -1 - Ignore this key | |
156 -2 - ASCII char | |
157 Other - Map non-ASCII keys into X keysyms so that they are looked up | |
158 correctly in keyboard.c | |
159 | |
160 Return, escape and tab are mapped to ASCII rather than coming back | |
161 as non-ASCII to be more compatible with old-style keyboard support. */ | |
162 | |
163 static int map_virt_key[256] = | |
164 { | |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
165 #ifdef MULE |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
166 -3, |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
167 #else |
9907 | 168 -1, |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
169 #endif |
9907 | 170 -1, /* VK_LBUTTON */ |
171 -1, /* VK_RBUTTON */ | |
172 0x69, /* VK_CANCEL */ | |
173 -1, /* VK_MBUTTON */ | |
174 -1, -1, -1, | |
175 8, /* VK_BACK */ | |
176 -2, /* VK_TAB */ | |
177 -1, -1, | |
178 11, /* VK_CLEAR */ | |
179 -2, /* VK_RETURN */ | |
180 -1, -1, | |
181 -1, /* VK_SHIFT */ | |
182 -1, /* VK_CONTROL */ | |
183 -1, /* VK_MENU */ | |
184 0x13, /* VK_PAUSE */ | |
185 -1, /* VK_CAPITAL */ | |
186 -1, -1, -1, -1, -1, -1, | |
187 -2, /* VK_ESCAPE */ | |
188 -1, -1, -1, -1, | |
189 -2, /* VK_SPACE */ | |
190 0x55, /* VK_PRIOR */ | |
191 0x56, /* VK_NEXT */ | |
192 0x57, /* VK_END */ | |
193 0x50, /* VK_HOME */ | |
194 0x51, /* VK_LEFT */ | |
195 0x52, /* VK_UP */ | |
196 0x53, /* VK_RIGHT */ | |
197 0x54, /* VK_DOWN */ | |
198 0x60, /* VK_SELECT */ | |
199 0x61, /* VK_PRINT */ | |
200 0x62, /* VK_EXECUTE */ | |
201 -1, /* VK_SNAPSHOT */ | |
202 0x63, /* VK_INSERT */ | |
203 0xff, /* VK_DELETE */ | |
204 0x6a, /* VK_HELP */ | |
205 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 0 - 9 */ | |
206 -1, -1, -1, -1, -1, -1, -1, | |
207 -2, -2, -2, -2, -2, -2, -2, -2, /* A - Z */ | |
208 -2, -2, -2, -2, -2, -2, -2, -2, | |
209 -2, -2, -2, -2, -2, -2, -2, -2, | |
210 -2, -2, | |
211 -1, -1, -1, -1, -1, | |
212 0xb0, /* VK_NUMPAD0 */ | |
213 0xb1, /* VK_NUMPAD1 */ | |
214 0xb2, /* VK_NUMPAD2 */ | |
215 0xb3, /* VK_NUMPAD3 */ | |
216 0xb4, /* VK_NUMPAD4 */ | |
217 0xb5, /* VK_NUMPAD5 */ | |
218 0xb6, /* VK_NUMPAD6 */ | |
219 0xb7, /* VK_NUMPAD7 */ | |
220 0xb8, /* VK_NUMPAD8 */ | |
221 0xb9, /* VK_NUMPAD9 */ | |
222 0xaa, /* VK_MULTIPLY */ | |
223 0xab, /* VK_ADD */ | |
224 0xac, /* VK_SEPARATOR */ | |
225 0xad, /* VK_SUBTRACT */ | |
226 0xae, /* VK_DECIMAL */ | |
227 0xaf, /* VK_DIVIDE */ | |
228 0xbe, /* VK_F1 */ | |
229 0xbf, /* VK_F2 */ | |
230 0xc0, /* VK_F3 */ | |
231 0xc1, /* VK_F4 */ | |
232 0xc2, /* VK_F5 */ | |
233 0xc3, /* VK_F6 */ | |
234 0xc4, /* VK_F7 */ | |
235 0xc5, /* VK_F8 */ | |
236 0xc6, /* VK_F9 */ | |
237 0xc7, /* VK_F10 */ | |
238 0xc8, /* VK_F11 */ | |
239 0xc9, /* VK_F12 */ | |
240 0xca, /* VK_F13 */ | |
241 0xcb, /* VK_F14 */ | |
242 0xcc, /* VK_F15 */ | |
243 0xcd, /* VK_F16 */ | |
244 0xce, /* VK_F17 */ | |
245 0xcf, /* VK_F18 */ | |
246 0xd0, /* VK_F19 */ | |
247 0xd1, /* VK_F20 */ | |
248 0xd2, /* VK_F21 */ | |
249 0xd3, /* VK_F22 */ | |
250 0xd4, /* VK_F23 */ | |
251 0xd5, /* VK_F24 */ | |
252 -1, -1, -1, -1, -1, -1, -1, -1, | |
253 0x7f, /* VK_NUMLOCK */ | |
12337
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
254 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x9f */ |
9907 | 255 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xaf */ |
256 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb9 */ | |
257 -2, /* ; */ | |
258 -2, /* = */ | |
259 -2, /* , */ | |
260 -2, /* \ */ | |
261 -2, /* . */ | |
262 -2, /* / */ | |
263 -2, /* ` */ | |
12337
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
264 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xcf */ |
9907 | 265 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xda */ |
12337
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
266 -2, -2, -2, -2, -2, /* 0xdf */ |
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
267 -2, -2, -2, -2, -2, |
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
268 -1, /* 0xe5 */ |
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
269 -2, /* oxe6 */ |
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
270 -1, -1, /* 0xe8 */ |
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
271 -2, -2, -2, -2, -2, -2, -2, /* 0xef */ |
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
272 -2, -2, -2, -2, -2, -2, |
85bdcc694c7a
(map_virt_key): Mark some additional chars as valid ASCII.
Richard M. Stallman <rms@gnu.org>
parents:
11386
diff
changeset
|
273 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 /* 0xff */ |
9907 | 274 }; |
275 | |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
276 /* return code -1 means that event_queue_ptr won't be incremented. |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
277 In other word, this event makes two key codes. (by himi) */ |
9907 | 278 static int |
279 key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev) | |
280 { | |
281 int map; | |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
282 int key_flag = 0; |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
283 static BOOL map_virt_key_init_done; |
9907 | 284 |
285 /* Skip key-up events. */ | |
286 if (event->bKeyDown == FALSE) | |
287 return 0; | |
288 | |
289 if (event->wVirtualKeyCode > 0xff) | |
290 { | |
291 printf ("Unknown key code %d\n", event->wVirtualKeyCode); | |
292 return 0; | |
293 } | |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
294 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
295 /* Patch needed for German keyboard. Ulrich Leodolter (1/11/95). */ |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
296 if (! map_virt_key_init_done) |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
297 { |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
298 short vk; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
299 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
300 if ((vk = VkKeyScan (0x3c)) >= 0 && vk < 256) map_virt_key[vk] = -2; /* less */ |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
301 if ((vk = VkKeyScan (0x3e)) >= 0 && vk < 256) map_virt_key[vk] = -2; /* greater */ |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
302 |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
303 map_virt_key_init_done = TRUE; |
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
304 } |
9907 | 305 |
306 /* BUGBUG - Ignores the repeat count | |
307 It's questionable whether we want to obey the repeat count anyway | |
308 since keys usually aren't repeated unless key events back up in | |
309 the queue. If they're backing up then we don't generally want | |
310 to honor them later since that leads to significant slop in | |
311 cursor motion when the system is under heavy load. */ | |
312 | |
313 map = map_virt_key[event->wVirtualKeyCode]; | |
314 if (map == -1) | |
315 { | |
316 return 0; | |
317 } | |
318 else if (map == -2) | |
319 { | |
320 /* ASCII */ | |
321 emacs_ev->kind = ascii_keystroke; | |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
322 key_flag = win32_kbd_patch_key (event); /* 95.7.25 by himi */ |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
323 if (key_flag == 0) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
324 return 0; |
10007
10fc4417831d
(SET_FRAME, key_event, do_mouse_event): Use accessor macros.
Karl Heuer <kwzh@gnu.org>
parents:
9907
diff
changeset
|
325 XSETINT (emacs_ev->code, event->uChar.AsciiChar); |
9907 | 326 } |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
327 #ifdef MULE |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
328 /* for IME */ |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
329 else if (map == -3) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
330 { |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
331 if ((event->dwControlKeyState & NLS_IME_CONVERSION) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
332 && !(event->dwControlKeyState & RIGHT_ALT_PRESSED) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
333 && !(event->dwControlKeyState & LEFT_ALT_PRESSED) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
334 && !(event->dwControlKeyState & RIGHT_CTRL_PRESSED) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
335 && !(event->dwControlKeyState & LEFT_CTRL_PRESSED)) |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
336 { |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
337 emacs_ev->kind = ascii_keystroke; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
338 XSETINT (emacs_ev->code, event->uChar.AsciiChar); |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
339 } |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
340 else |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
341 return 0; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
342 } |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
343 #endif |
9907 | 344 else |
345 { | |
346 /* non-ASCII */ | |
347 emacs_ev->kind = non_ascii_keystroke; | |
348 /* | |
349 * make_lispy_event () now requires non-ascii codes to have | |
350 * the full X keysym values (2nd byte is 0xff). add it on. | |
351 */ | |
352 map |= 0xff00; | |
10007
10fc4417831d
(SET_FRAME, key_event, do_mouse_event): Use accessor macros.
Karl Heuer <kwzh@gnu.org>
parents:
9907
diff
changeset
|
353 XSETINT (emacs_ev->code, map); |
9907 | 354 } |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
355 /* for Mule 2.2 (Based on Emacs 19.28) */ |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
356 #ifdef MULE |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
357 XSET (emacs_ev->frame_or_window, Lisp_Frame, get_frame ()); |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
358 #else |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
359 XSETFRAME (emacs_ev->frame_or_window, get_frame ()); |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
360 #endif |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
361 emacs_ev->modifiers = win32_kbd_mods_to_emacs (event->dwControlKeyState); |
9907 | 362 emacs_ev->timestamp = GetTickCount (); |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
363 if (key_flag == 2) return -1; /* 95.7.25 by himi */ |
9907 | 364 return 1; |
365 } | |
366 | |
367 /* Mouse position hook. */ | |
368 void | |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
369 win32_mouse_position (FRAME_PTR *f, |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
370 #ifndef MULE |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
371 int insist, |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
372 #endif |
9907 | 373 Lisp_Object *bar_window, |
374 enum scroll_bar_part *part, | |
375 Lisp_Object *x, | |
376 Lisp_Object *y, | |
377 unsigned long *time) | |
378 { | |
379 BLOCK_INPUT; | |
380 | |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
381 #ifndef MULE |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
382 insist = insist; |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
383 #endif |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
384 |
9907 | 385 *f = get_frame (); |
386 *bar_window = Qnil; | |
387 *part = 0; | |
12544
8f17bdb409cf
(win32_mouse_position, mouse_moved_to):
Karl Heuer <kwzh@gnu.org>
parents:
12337
diff
changeset
|
388 selected_frame->mouse_moved = 0; |
9907 | 389 |
390 *x = movement_pos.X; | |
391 *y = movement_pos.Y; | |
392 *time = movement_time; | |
393 | |
394 UNBLOCK_INPUT; | |
395 } | |
396 | |
397 /* Remember mouse motion and notify emacs. */ | |
398 static void | |
399 mouse_moved_to (int x, int y) | |
400 { | |
401 /* If we're in the same place, ignore it */ | |
402 if (x != movement_pos.X || y != movement_pos.Y) | |
403 { | |
12544
8f17bdb409cf
(win32_mouse_position, mouse_moved_to):
Karl Heuer <kwzh@gnu.org>
parents:
12337
diff
changeset
|
404 selected_frame->mouse_moved = 1; |
9907 | 405 movement_pos.X = x; |
406 movement_pos.Y = y; | |
407 movement_time = GetTickCount (); | |
408 } | |
409 } | |
410 | |
411 /* Consoles return button bits in a strange order: | |
412 least significant - Leftmost button | |
413 next - Rightmost button | |
414 next - Leftmost+1 | |
415 next - Leftmost+2... | |
416 | |
417 Assume emacs likes three button mice, so | |
418 Left == 0 | |
419 Middle == 1 | |
420 Right == 2 | |
421 Others increase from there. */ | |
422 | |
423 static int emacs_button_translation[NUM_MOUSE_BUTTONS] = | |
424 { | |
425 0, 2, 1, 3, 4, | |
426 }; | |
427 | |
428 static int | |
429 do_mouse_event (MOUSE_EVENT_RECORD *event, | |
430 struct input_event *emacs_ev) | |
431 { | |
432 static DWORD button_state = 0; | |
433 DWORD but_change, mask; | |
434 int i; | |
435 | |
436 if (event->dwEventFlags == MOUSE_MOVED) | |
437 { | |
438 /* For movement events we just note that the mouse has moved | |
439 so that emacs will generate drag events. */ | |
440 mouse_moved_to (event->dwMousePosition.X, event->dwMousePosition.Y); | |
441 return 0; | |
442 } | |
443 | |
444 /* It looks like the console code sends us a mouse event with | |
445 dwButtonState == 0 when a window is activated. Ignore this case. */ | |
446 if (event->dwButtonState == button_state) | |
447 return 0; | |
448 | |
449 emacs_ev->kind = mouse_click; | |
450 | |
451 /* Find out what button has changed state since the last button event. */ | |
452 but_change = button_state ^ event->dwButtonState; | |
453 mask = 1; | |
454 for (i = 0; i < NUM_MOUSE_BUTTONS; i++, mask <<= 1) | |
455 if (but_change & mask) | |
456 { | |
10007
10fc4417831d
(SET_FRAME, key_event, do_mouse_event): Use accessor macros.
Karl Heuer <kwzh@gnu.org>
parents:
9907
diff
changeset
|
457 XSETINT (emacs_ev->code, emacs_button_translation[i]); |
9907 | 458 break; |
459 } | |
460 | |
461 /* If the changed button is out of emacs' range (highly unlikely) | |
462 ignore this event. */ | |
463 if (i == NUM_MOUSE_BUTTONS) | |
464 return 0; | |
465 | |
466 button_state = event->dwButtonState; | |
467 emacs_ev->timestamp = GetTickCount (); | |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
468 emacs_ev->modifiers = win32_kbd_mods_to_emacs (event->dwControlKeyState) | |
9907 | 469 ((event->dwButtonState & mask) ? down_modifier : up_modifier); |
470 | |
10007
10fc4417831d
(SET_FRAME, key_event, do_mouse_event): Use accessor macros.
Karl Heuer <kwzh@gnu.org>
parents:
9907
diff
changeset
|
471 XSETFASTINT (emacs_ev->x, event->dwMousePosition.X); |
10fc4417831d
(SET_FRAME, key_event, do_mouse_event): Use accessor macros.
Karl Heuer <kwzh@gnu.org>
parents:
9907
diff
changeset
|
472 XSETFASTINT (emacs_ev->y, event->dwMousePosition.Y); |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
473 /* for Mule 2.2 (Based on Emacs 19.28 */ |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
474 #ifdef MULE |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
475 XSET (emacs_ev->frame_or_window, Lisp_Frame, get_frame ()); |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
476 #else |
11386
62e2ab942896
(do_mouse_event): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents:
11123
diff
changeset
|
477 XSETFRAME (emacs_ev->frame_or_window, get_frame ()); |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
478 #endif |
9907 | 479 |
480 return 1; | |
481 } | |
482 | |
483 static void | |
484 resize_event (WINDOW_BUFFER_SIZE_RECORD *event) | |
485 { | |
486 FRAME_PTR f = get_frame (); | |
487 | |
488 change_frame_size (f, event->dwSize.Y, event->dwSize.X, 0, 1); | |
489 SET_FRAME_GARBAGED (f); | |
490 } | |
491 | |
492 int | |
493 win32_read_socket (int sd, struct input_event *bufp, int numchars, | |
494 int waitp, int expected) | |
495 { | |
496 BOOL no_events = TRUE; | |
497 int nev, ret = 0, add; | |
498 | |
499 if (interrupt_input_blocked) | |
500 { | |
501 interrupt_input_pending = 1; | |
502 return -1; | |
503 } | |
504 | |
505 interrupt_input_pending = 0; | |
506 BLOCK_INPUT; | |
507 | |
508 for (;;) | |
509 { | |
510 nev = fill_queue (waitp != 0); | |
511 if (nev <= 0) | |
512 { | |
513 /* If nev == -1, there was some kind of error | |
514 If nev == 0 then waitp must be zero and no events were available | |
515 so return. */ | |
516 UNBLOCK_INPUT; | |
517 return nev; | |
518 } | |
519 | |
520 while (nev > 0 && numchars > 0) | |
521 { | |
522 switch (queue_ptr->EventType) | |
523 { | |
524 case KEY_EVENT: | |
525 add = key_event (&queue_ptr->Event.KeyEvent, bufp); | |
14245
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
526 if (add == -1) /* 95.7.25 by himi */ |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
527 { |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
528 queue_ptr--; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
529 add = 1; |
59d24d42958a
(WIN32_KEY_SHIFTED): Macro undefined.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
530 } |
9907 | 531 bufp += add; |
532 ret += add; | |
533 numchars -= add; | |
534 break; | |
535 | |
536 case MOUSE_EVENT: | |
537 add = do_mouse_event (&queue_ptr->Event.MouseEvent, bufp); | |
538 bufp += add; | |
539 ret += add; | |
540 numchars -= add; | |
541 break; | |
542 | |
543 case WINDOW_BUFFER_SIZE_EVENT: | |
544 resize_event (&queue_ptr->Event.WindowBufferSizeEvent); | |
545 break; | |
546 | |
547 case MENU_EVENT: | |
548 case FOCUS_EVENT: | |
549 /* Internal event types, ignored. */ | |
550 break; | |
551 } | |
552 | |
553 queue_ptr++; | |
554 nev--; | |
555 } | |
556 | |
557 if (ret > 0 || expected == 0) | |
558 break; | |
559 } | |
560 | |
561 UNBLOCK_INPUT; | |
562 return ret; | |
563 } |