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.