[BUG][FIX] YellowButtonBit and BlueButtonBit are swapped

Lex Spoon lex at cc.gatech.edu
Mon Mar 4 21:42:47 UTC 2002


Squeak has this code:

yellowButtonPressed
	"Answer true if the yellow mouse button is being pressed. This is the
second mouse button or option+click on the Mac."

	^ buttons anyMask: 2


And yet sq.h has this:

#define YellowButtonBit 1


Vice versa for the blue button.  Aren't these bitmaps reversed?

Searching through the SF code, only the Win32 code uses these #define's,
and it appears to be reversed there, as well.  On Win32, in the 3-button
mapping, the middle button is mapped to "blue", but at the Squeak level
it will appear as a "yellow" button.  (I guess the other ports use
hand-coded bitmasks.  This isn't as horrible as it sounds, considering
that the #define's haven't been there very long.)


It's interesting that at least two serious developers have gotten yellow
and blue swapped here: the  developer who made sq.h, and the developer
who did the win32 mouse-handling code.  This seems a pretty clear sign
that the red/yellow/blue terminology has completely fallen out of usage.
 I used to think that people would just get used to this terminology
over time.  But that will only happen if the terminology is actually
used.  It's not.


So I'm now in the camp that we should rename the mouse buttons.  How
about we give them names that describe what each button is mostly used
for?  When I talk to people about Squeak, for example, I will frequently
say "halo click to do such and such" and they seem to understand
immediately.  "blue click to do such and such" is unlikely to go over as
well, especially since I may get the color wrong myself!

Alternatively, we could name them 1, 2, and 3, but this loses the mental
crutch that a name like "halo button" offers, especially for learners. 
It is helpful just to know that a "halo button" exists.  But even this
is better than red/yellow/blue.  Presumably, they would be 1, 2, and 3
regardless of where they are located on the physical mouse; I bet a lot
of MS-Windows users, for example, think of the "third" button as the
middle one!  And lefties that have reversed their mouse will think of
the "first" button as the right one.


But I like naming them by function better.  Here's the list of names I
give to the buttons when I'm talking to people; the only one that nets
me much confusion is when I talk about the "menu" button.  Do these jive
with how others think about the mouse buttons?

	red  =>  main, primary
	yellow  =>  menu
	blue  =>  halo, gesture


If we can agree on some new names, then we could start a renaming
effort.  Really, that just means updating some official-looking Swiki
pages, and maybe updating Sensor and MorphicEvent.  After that, natural
language drift should take care of the rest.


-Lex


====

diff -c -r1.4 sq.h
*** sq.h	31 Jan 2002 21:10:06 -0000	1.4
--- sq.h	4 Mar 2002 22:21:20 -0000
***************
*** 237,244 ****
  
  /* button definitions */
  #define RedButtonBit 4
! #define BlueButtonBit 2
! #define YellowButtonBit 1
  
  /* modifier definitions */
  #define ShiftKeyBit 1
--- 237,244 ----
  
  /* button definitions */
  #define RedButtonBit 4
! #define YellowButtonBit 2
! #define BlueButtonBit 1
  
  /* modifier definitions */
  #define ShiftKeyBit 1



More information about the Squeak-dev mailing list