diff options
| author | Andrew Choi | 2002-08-03 22:21:09 +0000 |
|---|---|---|
| committer | Andrew Choi | 2002-08-03 22:21:09 +0000 |
| commit | 742fbed75b4cd5c2c2e7a8d4c0f4add9957e7f9a (patch) | |
| tree | 2d119dccd908ef943fd9343fbaa646808dc3e0e4 /src/keyboard.c | |
| parent | 365417014078a0f260fd24d41845aeb274b876c8 (diff) | |
| download | emacs-742fbed75b4cd5c2c2e7a8d4c0f4add9957e7f9a.tar.gz emacs-742fbed75b4cd5c2c2e7a8d4c0f4add9957e7f9a.zip | |
In src:
2002-08-03 Andrew Choi <akochoi@shaw.ca>
* macterm.c (USE_CARBON_EVENTS): New macro.
(macCtrlKey, macShiftKey, macMetaKey, macAltKey): New macros.
(x_iconify_frame): Call CollapseWindow.
(Vmac_reverse_ctrl_meta): New variable.
(Vmac_wheel_button_is_mouse_2): New variable.
(init_mac_drag_n_drop): New function.
(mac_do_receive_drag): New function.
(mac_handle_service_event): New function.
(init_service_handler): New function.
(mac_to_emacs_modifiers): New function.
(mac_event_to_emacs_modifiers): New function.
(mac_get_mouse_btn): New function.
(mac_convert_event_ref): New function.
(XTread_socket) [USE_CARBON_EVENTS]: Call ReceiveNextEvent,
SendEventToEventTarget, mac_event_to_emacs_modifiers, and
mac_get_mouse_btn.
(mac_initialize): Call init_mac_drag_n_drop and
init_service_handler.
* keyboard.c: Define Qmouse_wheel, mouse_wheel_syms, and
lispy_mouse_wheel_names for MAC_OSX as well as for WINDOWS_NT.
(kbd_buffer_get_event): Set used_mouse_menu for MENU_BAR_EVENT and
TOOL_BAR_EVENT for MAC_OS as well.
(make_lispy_event): Handle MOUSE_WHEEL_EVENT for MAC_OSX as well
as for WINDOWS_NT.
(syms_of_keyboard): Initialize Qmouse_wheel for MAC_OSX.
* termhooks.h (event_kind): Define MOUSE_WHEEL_EVENT also for
MAC_OSX.
In lisp:
2002-08-03 Andrew Choi <akochoi@shaw.ca>
* term/mac-win.el: Set keys to enable mouse wheel support.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index ce20d57913d..6c45139d80e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -550,8 +550,10 @@ Lisp_Object Qhelp_echo; | |||
| 550 | /* Symbols to denote kinds of events. */ | 550 | /* Symbols to denote kinds of events. */ |
| 551 | Lisp_Object Qfunction_key; | 551 | Lisp_Object Qfunction_key; |
| 552 | Lisp_Object Qmouse_click; | 552 | Lisp_Object Qmouse_click; |
| 553 | #ifdef WINDOWSNT | 553 | #if defined(WINDOWSNT) || defined(MAC_OSX) |
| 554 | Lisp_Object Qmouse_wheel; | 554 | Lisp_Object Qmouse_wheel; |
| 555 | #endif | ||
| 556 | #ifdef WINDOWSNT | ||
| 555 | Lisp_Object Qlanguage_change; | 557 | Lisp_Object Qlanguage_change; |
| 556 | #endif | 558 | #endif |
| 557 | Lisp_Object Qdrag_n_drop; | 559 | Lisp_Object Qdrag_n_drop; |
| @@ -644,7 +646,7 @@ int flow_control; | |||
| 644 | 646 | ||
| 645 | /* If we support a window system, turn on the code to poll periodically | 647 | /* If we support a window system, turn on the code to poll periodically |
| 646 | to detect C-g. It isn't actually used when doing interrupt input. */ | 648 | to detect C-g. It isn't actually used when doing interrupt input. */ |
| 647 | #ifdef HAVE_WINDOW_SYSTEM | 649 | #if defined(HAVE_WINDOW_SYSTEM) && !defined(USE_ASYNC_EVENTS) |
| 648 | #define POLL_FOR_INPUT | 650 | #define POLL_FOR_INPUT |
| 649 | #endif | 651 | #endif |
| 650 | 652 | ||
| @@ -3881,7 +3883,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) | |||
| 3881 | { | 3883 | { |
| 3882 | obj = make_lispy_event (event); | 3884 | obj = make_lispy_event (event); |
| 3883 | 3885 | ||
| 3884 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) | 3886 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined(MAC_OS) |
| 3885 | /* If this was a menu selection, then set the flag to inhibit | 3887 | /* If this was a menu selection, then set the flag to inhibit |
| 3886 | writing to last_nonmenu_event. Don't do this if the event | 3888 | writing to last_nonmenu_event. Don't do this if the event |
| 3887 | we're returning is (menu-bar), though; that indicates the | 3889 | we're returning is (menu-bar), though; that indicates the |
| @@ -4260,7 +4262,7 @@ timer_check (do_it_now) | |||
| 4260 | static Lisp_Object accent_key_syms; | 4262 | static Lisp_Object accent_key_syms; |
| 4261 | static Lisp_Object func_key_syms; | 4263 | static Lisp_Object func_key_syms; |
| 4262 | static Lisp_Object mouse_syms; | 4264 | static Lisp_Object mouse_syms; |
| 4263 | #ifdef WINDOWSNT | 4265 | #if defined(WINDOWSNT) || defined(MAC_OSX) |
| 4264 | static Lisp_Object mouse_wheel_syms; | 4266 | static Lisp_Object mouse_wheel_syms; |
| 4265 | #endif | 4267 | #endif |
| 4266 | static Lisp_Object drag_n_drop_syms; | 4268 | static Lisp_Object drag_n_drop_syms; |
| @@ -4669,7 +4671,7 @@ static char *iso_lispy_function_keys[] = | |||
| 4669 | 4671 | ||
| 4670 | Lisp_Object Vlispy_mouse_stem; | 4672 | Lisp_Object Vlispy_mouse_stem; |
| 4671 | 4673 | ||
| 4672 | #ifdef WINDOWSNT | 4674 | #if defined(WINDOWSNT) || defined(MAC_OSX) |
| 4673 | /* mouse-wheel events are generated by the wheel on devices such as | 4675 | /* mouse-wheel events are generated by the wheel on devices such as |
| 4674 | the MS Intellimouse. The wheel sits in between the left and right | 4676 | the MS Intellimouse. The wheel sits in between the left and right |
| 4675 | mouse buttons, and is typically used to scroll or zoom the window | 4677 | mouse buttons, and is typically used to scroll or zoom the window |
| @@ -5279,6 +5281,8 @@ make_lispy_event (event) | |||
| 5279 | Qnil)); | 5281 | Qnil)); |
| 5280 | } | 5282 | } |
| 5281 | } | 5283 | } |
| 5284 | #endif /* WINDOWS_NT */ | ||
| 5285 | #if defined(WINDOWS_NT) || defined(MAC_OSX) | ||
| 5282 | case MOUSE_WHEEL_EVENT: | 5286 | case MOUSE_WHEEL_EVENT: |
| 5283 | { | 5287 | { |
| 5284 | int part; | 5288 | int part; |
| @@ -5350,7 +5354,7 @@ make_lispy_event (event) | |||
| 5350 | Qnil)))); | 5354 | Qnil)))); |
| 5351 | } | 5355 | } |
| 5352 | } | 5356 | } |
| 5353 | #endif /* WINDOWSNT */ | 5357 | #endif /* WINDOWSNT || MAC_OSX */ |
| 5354 | 5358 | ||
| 5355 | case DRAG_N_DROP_EVENT: | 5359 | case DRAG_N_DROP_EVENT: |
| 5356 | { | 5360 | { |
| @@ -10433,9 +10437,11 @@ syms_of_keyboard () | |||
| 10433 | staticpro (&Qfunction_key); | 10437 | staticpro (&Qfunction_key); |
| 10434 | Qmouse_click = intern ("mouse-click"); | 10438 | Qmouse_click = intern ("mouse-click"); |
| 10435 | staticpro (&Qmouse_click); | 10439 | staticpro (&Qmouse_click); |
| 10436 | #ifdef WINDOWSNT | 10440 | #if defined(WINDOWSNT) || defined(MAC_OSX) |
| 10437 | Qmouse_wheel = intern ("mouse-wheel"); | 10441 | Qmouse_wheel = intern ("mouse-wheel"); |
| 10438 | staticpro (&Qmouse_wheel); | 10442 | staticpro (&Qmouse_wheel); |
| 10443 | #endif | ||
| 10444 | #ifdef WINDOWSNT | ||
| 10439 | Qlanguage_change = intern ("language-change"); | 10445 | Qlanguage_change = intern ("language-change"); |
| 10440 | staticpro (&Qlanguage_change); | 10446 | staticpro (&Qlanguage_change); |
| 10441 | #endif | 10447 | #endif |
| @@ -10583,10 +10589,9 @@ syms_of_keyboard () | |||
| 10583 | func_key_syms = Qnil; | 10589 | func_key_syms = Qnil; |
| 10584 | staticpro (&func_key_syms); | 10590 | staticpro (&func_key_syms); |
| 10585 | 10591 | ||
| 10586 | #ifdef WINDOWSNT | 10592 | #if defined(WINDOWSNT) || defined(MAC_OSX) |
| 10587 | mouse_wheel_syms = Qnil; | 10593 | mouse_wheel_syms = Qnil; |
| 10588 | staticpro (&mouse_wheel_syms); | 10594 | staticpro (&mouse_wheel_syms); |
| 10589 | |||
| 10590 | drag_n_drop_syms = Qnil; | 10595 | drag_n_drop_syms = Qnil; |
| 10591 | staticpro (&drag_n_drop_syms); | 10596 | staticpro (&drag_n_drop_syms); |
| 10592 | #endif | 10597 | #endif |