diff options
| author | Miles Bader | 2007-11-11 00:56:44 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-11-11 00:56:44 +0000 |
| commit | f23d76bdefbd4c06e14d69e99e50d35ce91c8226 (patch) | |
| tree | ded28d1da6df2d0135514bac83074f4ca1c9099a /src/keyboard.c | |
| parent | e2d092da5980a7d05a5428074f8eb4925fa801e8 (diff) | |
| parent | a457417ee5ba797ab1c91d35ee957bb7a7f8d4b6 (diff) | |
| download | emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.tar.gz emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.zip | |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 208 |
1 files changed, 139 insertions, 69 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 426ea34e3a4..0678fcdb4de 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -4017,9 +4017,6 @@ discard_mouse_events () | |||
| 4017 | if (sp->kind == MOUSE_CLICK_EVENT | 4017 | if (sp->kind == MOUSE_CLICK_EVENT |
| 4018 | || sp->kind == WHEEL_EVENT | 4018 | || sp->kind == WHEEL_EVENT |
| 4019 | || sp->kind == HORIZ_WHEEL_EVENT | 4019 | || sp->kind == HORIZ_WHEEL_EVENT |
| 4020 | #ifdef WINDOWSNT | ||
| 4021 | || sp->kind == W32_SCROLL_BAR_CLICK_EVENT | ||
| 4022 | #endif | ||
| 4023 | #ifdef HAVE_GPM | 4020 | #ifdef HAVE_GPM |
| 4024 | || sp->kind == GPM_CLICK_EVENT | 4021 | || sp->kind == GPM_CLICK_EVENT |
| 4025 | #endif | 4022 | #endif |
| @@ -4913,13 +4910,17 @@ char *lispy_function_keys[] = | |||
| 4913 | 0, /* VK_MENU 0x12 */ | 4910 | 0, /* VK_MENU 0x12 */ |
| 4914 | "pause", /* VK_PAUSE 0x13 */ | 4911 | "pause", /* VK_PAUSE 0x13 */ |
| 4915 | "capslock", /* VK_CAPITAL 0x14 */ | 4912 | "capslock", /* VK_CAPITAL 0x14 */ |
| 4916 | 4913 | "kana", /* VK_KANA/VK_HANGUL 0x15 */ | |
| 4917 | 0, 0, 0, 0, 0, 0, /* 0x15 .. 0x1A */ | 4914 | 0, /* 0x16 */ |
| 4918 | 4915 | "junja", /* VK_JUNJA 0x17 */ | |
| 4916 | "final", /* VK_FINAL 0x18 */ | ||
| 4917 | "kanji", /* VK_KANJI/VK_HANJA 0x19 */ | ||
| 4918 | 0, /* 0x1A */ | ||
| 4919 | "escape", /* VK_ESCAPE 0x1B */ | 4919 | "escape", /* VK_ESCAPE 0x1B */ |
| 4920 | 4920 | "convert", /* VK_CONVERT 0x1C */ | |
| 4921 | 0, 0, 0, 0, /* 0x1C .. 0x1F */ | 4921 | "non-convert", /* VK_NONCONVERT 0x1D */ |
| 4922 | 4922 | "accept", /* VK_ACCEPT 0x1E */ | |
| 4923 | "mode-change", /* VK_MODECHANGE 0x1F */ | ||
| 4923 | 0, /* VK_SPACE 0x20 */ | 4924 | 0, /* VK_SPACE 0x20 */ |
| 4924 | "prior", /* VK_PRIOR 0x21 */ | 4925 | "prior", /* VK_PRIOR 0x21 */ |
| 4925 | "next", /* VK_NEXT 0x22 */ | 4926 | "next", /* VK_NEXT 0x22 */ |
| @@ -4952,9 +4953,8 @@ char *lispy_function_keys[] = | |||
| 4952 | "lwindow", /* VK_LWIN 0x5B */ | 4953 | "lwindow", /* VK_LWIN 0x5B */ |
| 4953 | "rwindow", /* VK_RWIN 0x5C */ | 4954 | "rwindow", /* VK_RWIN 0x5C */ |
| 4954 | "apps", /* VK_APPS 0x5D */ | 4955 | "apps", /* VK_APPS 0x5D */ |
| 4955 | 4956 | 0, /* 0x5E */ | |
| 4956 | 0, 0, /* 0x5E .. 0x5F */ | 4957 | "sleep", |
| 4957 | |||
| 4958 | "kp-0", /* VK_NUMPAD0 0x60 */ | 4958 | "kp-0", /* VK_NUMPAD0 0x60 */ |
| 4959 | "kp-1", /* VK_NUMPAD1 0x61 */ | 4959 | "kp-1", /* VK_NUMPAD1 0x61 */ |
| 4960 | "kp-2", /* VK_NUMPAD2 0x62 */ | 4960 | "kp-2", /* VK_NUMPAD2 0x62 */ |
| @@ -5001,7 +5001,9 @@ char *lispy_function_keys[] = | |||
| 5001 | 5001 | ||
| 5002 | "kp-numlock", /* VK_NUMLOCK 0x90 */ | 5002 | "kp-numlock", /* VK_NUMLOCK 0x90 */ |
| 5003 | "scroll", /* VK_SCROLL 0x91 */ | 5003 | "scroll", /* VK_SCROLL 0x91 */ |
| 5004 | 5004 | /* Not sure where the following block comes from. | |
| 5005 | Windows headers have NEC and Fujitsu specific keys in | ||
| 5006 | this block, but nothing generic. */ | ||
| 5005 | "kp-space", /* VK_NUMPAD_CLEAR 0x92 */ | 5007 | "kp-space", /* VK_NUMPAD_CLEAR 0x92 */ |
| 5006 | "kp-enter", /* VK_NUMPAD_ENTER 0x93 */ | 5008 | "kp-enter", /* VK_NUMPAD_ENTER 0x93 */ |
| 5007 | "kp-prior", /* VK_NUMPAD_PRIOR 0x94 */ | 5009 | "kp-prior", /* VK_NUMPAD_PRIOR 0x94 */ |
| @@ -5021,19 +5023,47 @@ char *lispy_function_keys[] = | |||
| 5021 | * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys. | 5023 | * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys. |
| 5022 | * Used only as parameters to GetAsyncKeyState and GetKeyState. | 5024 | * Used only as parameters to GetAsyncKeyState and GetKeyState. |
| 5023 | * No other API or message will distinguish left and right keys this way. | 5025 | * No other API or message will distinguish left and right keys this way. |
| 5026 | * 0xA0 .. 0xA5 | ||
| 5024 | */ | 5027 | */ |
| 5025 | /* 0xA0 .. 0xEF */ | 5028 | 0, 0, 0, 0, 0, 0, |
| 5026 | 5029 | ||
| 5027 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 5030 | /* Multimedia keys. These are handled as WM_APPCOMMAND, which allows us |
| 5028 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 5031 | to enable them selectively, and gives access to a few more functions. |
| 5029 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 5032 | See lispy_multimedia_keys below. */ |
| 5030 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 5033 | 0, 0, 0, 0, 0, 0, 0, /* 0xA6 .. 0xAC Browser */ |
| 5031 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 5034 | 0, 0, 0, /* 0xAD .. 0xAF Volume */ |
| 5035 | 0, 0, 0, 0, /* 0xB0 .. 0xB3 Media */ | ||
| 5036 | 0, 0, 0, 0, /* 0xB4 .. 0xB7 Apps */ | ||
| 5032 | 5037 | ||
| 5033 | /* 0xF0 .. 0xF5 */ | 5038 | /* 0xB8 .. 0xC0 "OEM" keys - all seem to be punctuation. */ |
| 5039 | 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
| 5034 | 5040 | ||
| 5035 | 0, 0, 0, 0, 0, 0, | 5041 | /* 0xC1 - 0xDA unallocated, 0xDB-0xDF more OEM keys */ |
| 5042 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
| 5043 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
| 5036 | 5044 | ||
| 5045 | 0, /* 0xE0 */ | ||
| 5046 | "ax", /* VK_OEM_AX 0xE1 */ | ||
| 5047 | 0, /* VK_OEM_102 0xE2 */ | ||
| 5048 | "ico-help", /* VK_ICO_HELP 0xE3 */ | ||
| 5049 | "ico-00", /* VK_ICO_00 0xE4 */ | ||
| 5050 | 0, /* VK_PROCESSKEY 0xE5 */ | ||
| 5051 | "ico-clear", /* VK_ICO_CLEAR 0xE6 */ | ||
| 5052 | "packet", /* VK_PACKET 0xE7 */ | ||
| 5053 | 0, /* 0xE8 */ | ||
| 5054 | "reset", /* VK_OEM_RESET 0xE9 */ | ||
| 5055 | "jump", /* VK_OEM_JUMP 0xEA */ | ||
| 5056 | "oem-pa1", /* VK_OEM_PA1 0xEB */ | ||
| 5057 | "oem-pa2", /* VK_OEM_PA2 0xEC */ | ||
| 5058 | "oem-pa3", /* VK_OEM_PA3 0xED */ | ||
| 5059 | "wsctrl", /* VK_OEM_WSCTRL 0xEE */ | ||
| 5060 | "cusel", /* VK_OEM_CUSEL 0xEF */ | ||
| 5061 | "oem-attn", /* VK_OEM_ATTN 0xF0 */ | ||
| 5062 | "finish", /* VK_OEM_FINISH 0xF1 */ | ||
| 5063 | "copy", /* VK_OEM_COPY 0xF2 */ | ||
| 5064 | "auto", /* VK_OEM_AUTO 0xF3 */ | ||
| 5065 | "enlw", /* VK_OEM_ENLW 0xF4 */ | ||
| 5066 | "backtab", /* VK_OEM_BACKTAB 0xF5 */ | ||
| 5037 | "attn", /* VK_ATTN 0xF6 */ | 5067 | "attn", /* VK_ATTN 0xF6 */ |
| 5038 | "crsel", /* VK_CRSEL 0xF7 */ | 5068 | "crsel", /* VK_CRSEL 0xF7 */ |
| 5039 | "exsel", /* VK_EXSEL 0xF8 */ | 5069 | "exsel", /* VK_EXSEL 0xF8 */ |
| @@ -5046,6 +5076,65 @@ char *lispy_function_keys[] = | |||
| 5046 | 0 /* 0xFF */ | 5076 | 0 /* 0xFF */ |
| 5047 | }; | 5077 | }; |
| 5048 | 5078 | ||
| 5079 | /* Some of these duplicate the "Media keys" on newer keyboards, | ||
| 5080 | but they are delivered to the application in a different way. */ | ||
| 5081 | static char *lispy_multimedia_keys[] = | ||
| 5082 | { | ||
| 5083 | 0, | ||
| 5084 | "browser-back", | ||
| 5085 | "browser-forward", | ||
| 5086 | "browser-refresh", | ||
| 5087 | "browser-stop", | ||
| 5088 | "browser-search", | ||
| 5089 | "browser-favorites", | ||
| 5090 | "browser-home", | ||
| 5091 | "volume-mute", | ||
| 5092 | "volume-down", | ||
| 5093 | "volume-up", | ||
| 5094 | "media-next", | ||
| 5095 | "media-previous", | ||
| 5096 | "media-stop", | ||
| 5097 | "media-play-pause", | ||
| 5098 | "mail", | ||
| 5099 | "media-select", | ||
| 5100 | "app-1", | ||
| 5101 | "app-2", | ||
| 5102 | "bass-down", | ||
| 5103 | "bass-boost", | ||
| 5104 | "bass-up", | ||
| 5105 | "treble-down", | ||
| 5106 | "treble-up", | ||
| 5107 | "mic-volume-mute", | ||
| 5108 | "mic-volume-down", | ||
| 5109 | "mic-volume-up", | ||
| 5110 | "help", | ||
| 5111 | "find", | ||
| 5112 | "new", | ||
| 5113 | "open", | ||
| 5114 | "close", | ||
| 5115 | "save", | ||
| 5116 | "print", | ||
| 5117 | "undo", | ||
| 5118 | "redo", | ||
| 5119 | "copy", | ||
| 5120 | "cut", | ||
| 5121 | "paste", | ||
| 5122 | "mail-reply", | ||
| 5123 | "mail-forward", | ||
| 5124 | "mail-send", | ||
| 5125 | "spell-check", | ||
| 5126 | "toggle-dictate-command", | ||
| 5127 | "mic-toggle", | ||
| 5128 | "correction-list", | ||
| 5129 | "media-play", | ||
| 5130 | "media-pause", | ||
| 5131 | "media-record", | ||
| 5132 | "media-fast-forward", | ||
| 5133 | "media-rewind", | ||
| 5134 | "media-channel-up", | ||
| 5135 | "media-channel-down" | ||
| 5136 | }; | ||
| 5137 | |||
| 5049 | #else /* not HAVE_NTGUI */ | 5138 | #else /* not HAVE_NTGUI */ |
| 5050 | 5139 | ||
| 5051 | /* This should be dealt with in XTread_socket now, and that doesn't | 5140 | /* This should be dealt with in XTread_socket now, and that doesn't |
| @@ -5563,6 +5652,21 @@ make_lispy_event (event) | |||
| 5563 | (sizeof (lispy_function_keys) | 5652 | (sizeof (lispy_function_keys) |
| 5564 | / sizeof (lispy_function_keys[0]))); | 5653 | / sizeof (lispy_function_keys[0]))); |
| 5565 | 5654 | ||
| 5655 | #ifdef WINDOWSNT | ||
| 5656 | case MULTIMEDIA_KEY_EVENT: | ||
| 5657 | if (event->code < (sizeof (lispy_multimedia_keys) | ||
| 5658 | / sizeof (lispy_multimedia_keys[0])) | ||
| 5659 | && event->code > 0 && lispy_multimedia_keys[event->code]) | ||
| 5660 | { | ||
| 5661 | return modify_event_symbol (event->code, event->modifiers, | ||
| 5662 | Qfunction_key, Qnil, | ||
| 5663 | lispy_multimedia_keys, &func_key_syms, | ||
| 5664 | (sizeof (lispy_multimedia_keys) | ||
| 5665 | / sizeof (lispy_multimedia_keys[0]))); | ||
| 5666 | } | ||
| 5667 | return Qnil; | ||
| 5668 | #endif | ||
| 5669 | |||
| 5566 | #ifdef HAVE_MOUSE | 5670 | #ifdef HAVE_MOUSE |
| 5567 | /* A mouse click. Figure out where it is, decide whether it's | 5671 | /* A mouse click. Figure out where it is, decide whether it's |
| 5568 | a press, click or drag, and build the appropriate structure. */ | 5672 | a press, click or drag, and build the appropriate structure. */ |
| @@ -6003,52 +6107,6 @@ make_lispy_event (event) | |||
| 6003 | 6107 | ||
| 6004 | #endif /* USE_TOOLKIT_SCROLL_BARS */ | 6108 | #endif /* USE_TOOLKIT_SCROLL_BARS */ |
| 6005 | 6109 | ||
| 6006 | #ifdef WINDOWSNT | ||
| 6007 | case W32_SCROLL_BAR_CLICK_EVENT: | ||
| 6008 | { | ||
| 6009 | int button = event->code; | ||
| 6010 | int is_double; | ||
| 6011 | Lisp_Object position; | ||
| 6012 | Lisp_Object *start_pos_ptr; | ||
| 6013 | Lisp_Object start_pos; | ||
| 6014 | |||
| 6015 | { | ||
| 6016 | Lisp_Object window; | ||
| 6017 | Lisp_Object portion_whole; | ||
| 6018 | Lisp_Object part; | ||
| 6019 | |||
| 6020 | window = event->frame_or_window; | ||
| 6021 | portion_whole = Fcons (event->x, event->y); | ||
| 6022 | part = *scroll_bar_parts[(int) event->part]; | ||
| 6023 | |||
| 6024 | position | ||
| 6025 | = Fcons (window, | ||
| 6026 | Fcons (Qvertical_scroll_bar, | ||
| 6027 | Fcons (portion_whole, | ||
| 6028 | Fcons (make_number (event->timestamp), | ||
| 6029 | Fcons (part, Qnil))))); | ||
| 6030 | } | ||
| 6031 | |||
| 6032 | /* Always treat W32 scroll bar events as clicks. */ | ||
| 6033 | event->modifiers |= click_modifier; | ||
| 6034 | |||
| 6035 | { | ||
| 6036 | /* Get the symbol we should use for the mouse click. */ | ||
| 6037 | Lisp_Object head; | ||
| 6038 | |||
| 6039 | head = modify_event_symbol (button, | ||
| 6040 | event->modifiers, | ||
| 6041 | Qmouse_click, | ||
| 6042 | Vlispy_mouse_stem, | ||
| 6043 | NULL, &mouse_syms, | ||
| 6044 | XVECTOR (mouse_syms)->size); | ||
| 6045 | return Fcons (head, | ||
| 6046 | Fcons (position, | ||
| 6047 | Qnil)); | ||
| 6048 | } | ||
| 6049 | } | ||
| 6050 | #endif /* WINDOWSNT */ | ||
| 6051 | |||
| 6052 | case DRAG_N_DROP_EVENT: | 6110 | case DRAG_N_DROP_EVENT: |
| 6053 | { | 6111 | { |
| 6054 | FRAME_PTR f; | 6112 | FRAME_PTR f; |
| @@ -7097,7 +7155,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7097 | int nread = 0; | 7155 | int nread = 0; |
| 7098 | 7156 | ||
| 7099 | if (!terminal->name) /* Don't read from a dead terminal. */ | 7157 | if (!terminal->name) /* Don't read from a dead terminal. */ |
| 7100 | return; | 7158 | return 0; |
| 7101 | 7159 | ||
| 7102 | if (terminal->type != output_termcap) | 7160 | if (terminal->type != output_termcap) |
| 7103 | abort (); | 7161 | abort (); |
| @@ -11571,9 +11629,12 @@ init_keyboard () | |||
| 11571 | #ifdef MULTI_KBOARD | 11629 | #ifdef MULTI_KBOARD |
| 11572 | current_kboard = initial_kboard; | 11630 | current_kboard = initial_kboard; |
| 11573 | #endif | 11631 | #endif |
| 11632 | /* Re-initialize the keyboard again. */ | ||
| 11574 | wipe_kboard (current_kboard); | 11633 | wipe_kboard (current_kboard); |
| 11575 | init_kboard (current_kboard); | 11634 | init_kboard (current_kboard); |
| 11576 | /* Leave Vwindow_system at its `t' default for now. */ | 11635 | /* A value of nil for Vwindow_system normally means a tty, but we also use |
| 11636 | it for the initial terminal since there is no window system there. */ | ||
| 11637 | current_kboard->Vwindow_system = Qnil; | ||
| 11577 | 11638 | ||
| 11578 | if (!noninteractive) | 11639 | if (!noninteractive) |
| 11579 | { | 11640 | { |
| @@ -12399,6 +12460,15 @@ and the Lisp function within which the error was signaled. */); | |||
| 12399 | Help functions bind this to allow help on disabled menu items | 12460 | Help functions bind this to allow help on disabled menu items |
| 12400 | and tool-bar buttons. */); | 12461 | and tool-bar buttons. */); |
| 12401 | Venable_disabled_menus_and_buttons = Qnil; | 12462 | Venable_disabled_menus_and_buttons = Qnil; |
| 12463 | |||
| 12464 | #ifdef MULTI_KBOARD | ||
| 12465 | /* Create the initial keyboard. */ | ||
| 12466 | initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | ||
| 12467 | init_kboard (initial_kboard); | ||
| 12468 | /* Vwindow_system is left at t for now. */ | ||
| 12469 | initial_kboard->next_kboard = all_kboards; | ||
| 12470 | all_kboards = initial_kboard; | ||
| 12471 | #endif | ||
| 12402 | } | 12472 | } |
| 12403 | 12473 | ||
| 12404 | void | 12474 | void |