Squeak
  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 2:10 pm UTC on 2 November 2020
What's all this about "red", "yellow", and "blue" buttons? My mouse's buttons are all the same color.

The description below the horizontal rule is historical and interesting but somewhat out of date (circa 2103!). So, here is an attempt to update the info.

Computer mice are almost all 3-button these days (2020), avoiding the complications of "do I press cmd/ctl for that?" in most cases. Unfortunately the world at large has pretty much agreed on ignoring the middle button of the three and leaving it as a scroll input. Apple of course have their own approach with the Magic Mouse providing a full touch-tablet as the mouse top - still works as a left button and right button and can be confugured to have a tertiary button avaialbe via apps such as Better Touch Tool. This means that many users are familiar with having a menu pop up as a result of pressing the right mouse button rather than the Smalltalk traditional middle button press.

In order to help with that we have a preference that you can set; check the Preferences Browser and set the 'Swap mouse buttons' checkbox. FAQ: Swapping Yellow and Blue Mouse Buttons

This preference in the image means you shouldn't mess with any VM settings affecting the mouse buttons.

We do still have the issue of describing the mouse buttons in documentation, as mentioned below. Using the colours still seems natural to the older Smalltalkers among us but a lto of newcomers are completely baffled by it. In the latest Help Browser pages we are starting to use <select>, <menu> and <halo> in an attempt to be unambiguous.


Most laptops provide a trackpad of some form and many only provide one button; these still require the use of cmd/ctl or opt keys.

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



To add: graphics with mouse buttons colored



Mac

External Image

MSWindows

External Image

Unix

External Image