emacs-devel
[Top][All Lists]
Advanced

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

Re: Mac OSX Mouse Button Mapping (was Concerns)


From: Steven Tamm
Subject: Re: Mac OSX Mouse Button Mapping (was Concerns)
Date: Thu, 10 Oct 2002 18:12:09 -0700

        * macterm.c (syms_of_macterm, mac_get_mouse_btn): Reversed
        functionality of mac-wheel-button-is-mouse-2 to be correct.  Also
        switched the default to Qnil from Qt.

You are, as is now painfully obvious, correct. The code was reversed and so was the value of the default value. I've checked in the change to CVS now; the default value for mac_wheel_button_is_mouse_2 is now Qnil. My mouse appears to be working differently with new drivers (and Jaguar), this may have caused my confusion. After using VNC for a little bit, I saw what was going on.

Thanks again,
-Steven

On Thursday, October 10, 2002, at 05:13  AM, Piet van Oostrum wrote:

Carsten Bormann <address@hidden> (CB) writes:

CB> That's what the docs say, but not what happens on my Mac with the various
CB> USB mice I have.
CB> I need to set it to nil to have the wheel button as mouse-2 and the right
CB> button as mouse-3.
CB> If I set mac-wheel-button-is-mouse-2 to t, the wheel button is mouse-3 CB> and the right button is mouse-2, which is quite confusing of course. Maybe CB> there is some other remapping at work, but I have no idea where to look.

The code just has the selection reversed:

In macterm.c:

static int
mac_get_mouse_btn (EventRef ref)
{
  EventMouseButton result = kEventMouseButtonPrimary;
GetEventParameter (ref, kEventParamMouseButton, typeMouseButton, NULL,
                    sizeof (EventMouseButton), NULL, &result);
  switch (result)
    {
    case kEventMouseButtonPrimary:
      return 0;
    case kEventMouseButtonSecondary:
return NILP (Vmac_wheel_button_is_mouse_2) ? 2 : 1; <<<<<<<<<
    case kEventMouseButtonTertiary:
    case 4:  /* 4 is the number for the mouse wheel button */
return NILP (Vmac_wheel_button_is_mouse_2) ? 1 : 2; <<<<<<<<<
    default:
      return 0;
    }
}

These two lines should be swapped. E.g. in the current code if
mac-wheel-button-is-mouse-2 is NIL and the mouse-wheel is pressed, 1 is
returned (i.e. mouse-2), if it is non-nil, 2 is returned (i.e. mouse-3). For the secondary button it is the reverse. Clearly this is the opposite
of what it should be.





reply via email to

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