emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS X: mouse wheel on powerbooks broken, Option modifier


From: YAMAMOTO Mitsuharu
Subject: Re: OS X: mouse wheel on powerbooks broken, Option modifier
Date: Fri, 10 Jun 2005 19:15:32 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sun, 5 Jun 2005 13:34:20 +0100, David Reitter <address@hidden> said:

> Forwarding this with a subject line. I can confirm both bugs.

> Howard Melman:

> I'm using Aquamacs 0.9.2b5 on a new G4 PowerBook running 10.4.1. I
> find that Option-u doesn't generate a M-u key sequence and therefore
> doesn't run uppercase-word. I say it doesn't generate a key sequence
> because if I do C-h c and then type Option-u at the prompt, nothing
> happens, it's as if I didn't type anything. Works fine for other key
> combinations (e.g., Option-c).

Could you try the following patch?

> Also I find the new two finger scrolling on the trackpad doesn't do
> anything.

I can't test about this one because I don't have a recent PowerBook.
Does anyone know what kind of Carbon event is produced by the two
finger scrolling?

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.117
diff -c -r1.117 macterm.c
*** src/macterm.c       6 Jun 2005 20:23:56 -0000       1.117
--- src/macterm.c       10 Jun 2005 05:58:22 -0000
***************
*** 7601,7645 ****
  
  /* Normally, ConvertEventRefToEventRecord will correctly handle all
     events.  However the click of the mouse wheel is not converted to a
!    mouseDown or mouseUp event.  This calls ConvertEventRef, but then
!    checks to see if it is a mouse up or down carbon event that has not
!    been converted, and if so, converts it by hand (to be picked up in
!    the XTread_socket loop).  */
  static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord 
*eventRec)
  {
    Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec);
!   /* Do special case for mouse wheel button.  */
!   if (!result && GetEventClass (eventRef) == kEventClassMouse)
      {
!       UInt32 kind = GetEventKind (eventRef);
!       if (kind == kEventMouseDown && !(eventRec->what == mouseDown))
        {
          eventRec->what = mouseDown;
!         result=1;
!       }
!       if (kind == kEventMouseUp && !(eventRec->what == mouseUp))
!       {
          eventRec->what = mouseUp;
!         result=1;
        }
!       if (result)
        {
!         /* Need where and when.  */
!         UInt32 mods;
!         GetEventParameter (eventRef, kEventParamMouseLocation,
!                            typeQDPoint, NULL, sizeof (Point),
!                            NULL, &eventRec->where);
!         /* Use two step process because new event modifiers are
!            32-bit and old are 16-bit.  Currently, only loss is
!            NumLock & Fn. */
!         GetEventParameter (eventRef, kEventParamKeyModifiers,
!                            typeUInt32, NULL, sizeof (UInt32),
!                            NULL, &mods);
!         eventRec->modifiers = mods;
  
!         eventRec->when = EventTimeToTicks (GetEventTime (eventRef));
        }
      }
    return result;
  }
  
--- 7601,7679 ----
  
  /* Normally, ConvertEventRefToEventRecord will correctly handle all
     events.  However the click of the mouse wheel is not converted to a
!    mouseDown or mouseUp event.  Likewise for dead key down events.
!    This calls ConvertEventRef, but then checks to see if it is a mouse
!    up/down, or a dead key down carbon event that has not been
!    converted, and if so, converts it by hand (to be picked up in the
!    XTread_socket loop).  */
  static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord 
*eventRec)
  {
    Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec);
! 
!   if (result)
!     return result;
! 
!   switch (GetEventClass (eventRef))
      {
!     case kEventClassMouse:
!       switch (GetEventKind (eventRef))
        {
+       case kEventMouseDown:
          eventRec->what = mouseDown;
!         result = 1;
!         break;
! 
!       case kEventMouseUp:
          eventRec->what = mouseUp;
!         result = 1;
!         break;
! 
!       default:
!         break;
        }
! 
!     case kEventClassKeyboard:
!       switch (GetEventKind (eventRef))
        {
!       case kEventRawKeyDown:
!         {
!           unsigned char char_codes;
!           UInt32 key_code;
! 
!           eventRec->what = keyDown;
!           GetEventParameter (eventRef, kEventParamKeyMacCharCodes, typeChar,
!                              NULL, sizeof (char), NULL, &char_codes);
!           GetEventParameter (eventRef, kEventParamKeyCode, typeUInt32,
!                              NULL, sizeof (UInt32), NULL, &key_code);
!           eventRec->message = char_codes | ((key_code & 0xff) << 8);
!           result = 1;
!         }
!         break;
  
!       default:
!         break;
        }
+ 
+     default:
+       break;
      }
+ 
+   if (result)
+     {
+       /* Need where and when.  */
+       UInt32 mods;
+ 
+       GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint,
+                        NULL, sizeof (Point), NULL, &eventRec->where);
+       /* Use two step process because new event modifiers are 32-bit
+        and old are 16-bit.  Currently, only loss is NumLock & Fn. */
+       GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32,
+                        NULL, sizeof (UInt32), NULL, &mods);
+       eventRec->modifiers = mods;
+ 
+       eventRec->when = EventTimeToTicks (GetEventTime (eventRef));
+     }
+ 
    return result;
  }
  
***************
*** 9362,9368 ****
            if ((!NILP (Vmac_pass_command_to_system)
                 || !(er.modifiers & cmdKey))
                && (!NILP (Vmac_pass_control_to_system)
!                   || !(er.modifiers & controlKey)))
              if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
                  != eventNotHandledErr)
                break;
--- 9396,9405 ----
            if ((!NILP (Vmac_pass_command_to_system)
                 || !(er.modifiers & cmdKey))
                && (!NILP (Vmac_pass_control_to_system)
!                   || !(er.modifiers & controlKey))
!               && (!NILP (Vmac_command_key_is_meta)
!                   && NILP (Vmac_option_modifier)
!                   || !(er.modifiers & optionKey)))
              if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
                  != eventNotHandledErr)
                break;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]