links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
FAQ: Mouse Buttons
Last updated at 3:31 am UTC on 20 November 2013
What's all this about "red", "yellow", and "blue" buttons? My mouse's buttons are all the same color.

The Smalltalk image from which Squeak is derived was designed to run with a three-button mouse on an Alto or Dorado computer. These buttons were known as the Red button, Yellow button, and Blue button, and some mice on the Parc computers really had buttons of these colors.

For most 3-button mice, the mapping is:
        left-mouse              -> "red"  (a.k.a. primary)
        middle-mouse            -> "yellow"  (a.k.a. secondary)
        right-mouse             -> "blue"  (a.k.a. meta or tertiary)
        alt-left-mouse          -> "blue"  (meta)

Some Win32 machines have only 2-button mice. That's why the default mapping on Win32 is:
        left-mouse              -> "red"  (primary)
        right-mouse             -> "yellow"  (secondary)
        alt-left-mouse          -> "blue"  (meta)

However, if you do have a 3-button mouse on Win32 (or one with a scroll-wheel which you can press), you might want to set the "use 3 button mapping" to get the default reading from above. To do this, right-click on the Windows titlebar of the Squeak application (or press F2), and select the "VM Preferences->Use 3 button mouse mapping" menu item.

Finally, Macs only have one mouse button. The mapping on Macs historically was:
        mouse                   -> "red"  (primary)
        option-mouse            -> "yellow"  (secondary)
        cmd-mouse               -> "blue"  (meta)

But for Macs using the carbon VM 3.8.12b6 or higher we now have
info.plist settings to control the mapping for buttons number 1,2,3 to "red", "yellow", "blue"
in conjuction with modifier keys.
See http://www.smalltalkconsulting.com/html/squeakinfoplist.html for more information.

I got that, but what do the three buttons do?

Although the meaning of buttons can be modified, the general assignment is this:
        "red"                   -> select
        "yellow"                -> menu
        "blue"                  -> meta operation       

In MVC, the meta operation is the window menu. In Morphic it brings up the morph "halo" (the colored dots).

To summarize,

\red:primaryyellow:secondaryblue:meta, tertiary
3-button miceleft-mousemiddle-mouseright-mouse
Win32 (2-button)left-mouseright-mousealt-left-mouse
mac (1-button)mouseoption-mousecmd-mouse
functionselectmenumeta operation

For more description and a nice picture of a red-yellow-blue button mouse, see http://wiki.squeak.org/squeak/uploads/SqueakLanguageRef.3.html#UsingMousing
Note that the picture doesn't show the original color squence of the Parc machines. That was red - yellow - blue.

The red button is always the primary button on all platforms. There exists sometimes some confusion concerning the blue and the yellow button. For this reason there is now a Preferences setting to swap them within the image so that it suits your needs. FAQ: Swapping Yellow and Blue Mouse Buttons

Doug Way thinks the reason that there is confusion over this is that Windows mice have evolved from having two buttons to often having three buttons, with the middle button (usually a clickable scroll wheel) being the third button added.

In other words, the following is always true:

red -> primary
yellow -> secondary
blue -> tertiary

On Unix machines with three buttons one thinks of the rightmost button as the tertiary (thirdmost) button. Apparently the same was true for the Altos and most other Smalltalk machines.

But on Windows platforms, the middle button is treated as the thirdmost button. This is the source for confusion. (Also, it probably helps that right-clicking typically brings up pop-up menus in the Windows UI, and people like having the same behavior in Squeak.)

{RISC OS machines have the proper number of buttons, and so need no complex and confusing mapping. The only point you need to remember is that the 'adjust' button is used for the window menu and not for adjusting the selection. – TPR}

See also