Updated 2007-09-13 15:12:58 by LV

Most Apple computers are delivered with a mouse with only one button. In MacOS X, the usual convention to invoke the context menu (if any is required) is to hold down the Control key (not the Command key) whilst clicking the button. Since the mouse is a standard USB mouse, however, it is easy to substitute a two- or three-button mouse for the original. Then a click of the right-button will invoke the context menu, as on Windows and (most) *nix systems.

Using TkAqua, however, there is a difference in the events that are generated. For example, I have a two-button + wheel mouse that I can use with a Windows PC and a MacOS X system. It generates a <Button-2> event for a right-click and a <Button-3> event for a click of the wheel when used on MacOS X, and vice versa when used on Windows.

As Jim Ingham explains, the "Tk Aqua code just reports the button number that the system sends. On Aqua, right mouse button always sends button 2, since that way you get the same button number for right mouse click for a two and a three button mouse. Then if you have a third button, that sends 3."

Daniel Steffen notes that "Carbon with the system supplied Mac OS X USB mouse driver assigns button-2 to the right mouse button and button-3 to the middle button; a holdover from a time when there were mice with only 1 or 2 buttons on the mac..."

He continues: "I've recently made changes to tkaqua to pass on all the 5 possible mouse buttons supported by Tk, the ordering depends on your hardware, but button-2 and button-3 will continue to be reversed from the usual unix convention for backwards compat reasons."

Daniel Steffen has also recently been working with Revar Desmera to add support for two-finger scrolling with newer powerbook trackpads.

-- Alastair Davies (2005-09-21)


Category Mac ]