• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/src/

Lines Matching +defs:event +defs:key

1 /* Input event support for Emacs on the Microsoft W32 API.
79 extern unsigned int w32_key_to_modifier (int key);
127 w32_kbd_mods_to_emacs (DWORD mods, WORD key)
162 && ( (key == VK_BACK)
163 || (key == VK_TAB)
164 || (key == VK_CLEAR)
165 || (key == VK_RETURN)
166 || (key == VK_ESCAPE)
167 || ((key >= VK_SPACE) && (key <= VK_HELP))
168 || ((key >= VK_NUMPAD0) && (key <= VK_F24))
169 || ((key >= VK_NUMPAD_CLEAR) && (key <= VK_NUMPAD_DELETE))
189 /* Return nonzero if the virtual key is a dead key. */
200 /* The return code indicates key code size. */
202 w32_kbd_patch_key (KEY_EVENT_RECORD *event)
204 unsigned int key_code = event->wVirtualKeyCode;
205 unsigned int mods = event->dwControlKeyState;
212 event->uChar.AsciiChar = ansi_code[2];
216 if (event->uChar.AsciiChar != 0)
225 /* If we recognize right-alt and left-ctrl as AltGr, set the key
238 convert a dead key in console mode on NT4. Unfortunately, trying
244 if (is_dead_key (event->wVirtualKeyCode))
254 isdead = ToUnicode (event->wVirtualKeyCode, event->wVirtualScanCode,
272 isdead = ToAscii (event->wVirtualKeyCode, event->wVirtualScanCode,
278 event->uChar.AsciiChar = ansi_code[0];
288 In other word, this event makes two key codes. (by himi) */
290 key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev, int *isdead)
297 /* Skip key-up events. */
298 if (!event->bKeyDown)
300 switch (event->wVirtualKeyCode)
316 if (faked_key == event->wVirtualKeyCode)
323 switch (event->wVirtualKeyCode)
329 menu if no other key was pressed) by simulating a press of
366 /* Decide whether to treat as modifier or function key. */
371 /* Decide whether to treat as modifier or function key. */
376 /* Decide whether to treat as modifier or function key. */
381 /* Ensure the appropriate lock key state is off (and the
383 wParam = event->wVirtualKeyCode;
386 /* Fake another press of the relevant key. Apparently, this
403 which is confusing for purposes of key binding; convert
405 event->wVirtualKeyCode = VK_PAUSE;
409 for purposes of key binding; convert these back into
410 VK_NUMLOCK events, at least when we want to see NumLock key
414 && (event->dwControlKeyState
416 event->wVirtualKeyCode = VK_NUMLOCK;
421 event->dwControlKeyState |= mod_key_state;
424 event->wVirtualKeyCode =
425 map_keypad_keys (event->wVirtualKeyCode,
426 (event->dwControlKeyState & ENHANCED_KEY));
428 if (lispy_function_keys[event->wVirtualKeyCode] == 0)
433 && (event->dwControlKeyState & LEFT_CTRL_PRESSED)
434 && (event->dwControlKeyState & RIGHT_ALT_PRESSED))
436 /* Don't try to interpret AltGr key chords; ToAscii seems not
439 /* Handle key chords including any modifiers other than shift
442 else if (event->dwControlKeyState
454 if ('A' <= event->wVirtualKeyCode && event->wVirtualKeyCode <= 'Z')
456 event->uChar.AsciiChar = event->wVirtualKeyCode;
457 if ((event->dwControlKeyState & SHIFT_PRESSED) == 0)
458 event->uChar.AsciiChar += ('a' - 'A');
461 base character (ie. translating the base key plus shift
463 else if (event->uChar.AsciiChar == 0)
464 w32_kbd_patch_key (event);
466 if (event->uChar.AsciiChar == 0)
468 emacs_ev->code = event->uChar.AsciiChar;
473 emacs_ev->code = event->wVirtualKeyCode;
477 emacs_ev->modifiers = w32_kbd_mods_to_emacs (event->dwControlKeyState,
478 event->wVirtualKeyCode);
568 do_mouse_event (MOUSE_EVENT_RECORD *event,
575 if (event->dwEventFlags == MOUSE_MOVED)
579 mouse_moved_to (event->dwMousePosition.X, event->dwMousePosition.Y);
583 /* It looks like the console code sends us a mouse event with
585 if (event->dwButtonState == button_state)
590 /* Find out what button has changed state since the last button event. */
591 but_change = button_state ^ event->dwButtonState;
603 button_state = event->dwButtonState;
605 emacs_ev->modifiers = w32_kbd_mods_to_emacs (event->dwControlKeyState, 0) |
606 ((event->dwButtonState & mask) ? down_modifier : up_modifier);
608 XSETFASTINT (emacs_ev->x, event->dwMousePosition.X);
609 XSETFASTINT (emacs_ev->y, event->dwMousePosition.Y);
621 resize_event (WINDOW_BUFFER_SIZE_RECORD *event)
625 change_frame_size (f, event->dwSize.Y, event->dwSize.X, 0, 1);
707 /* Internal event types, ignored. */