Unix VM change for swapping mouse buttons
Stephan Rudlof
sr at evolgo.de
Fri Jul 7 23:39:57 UTC 2000
Ned,
Ned Konz wrote:
>
> OK, I fixed my problem. Now I can specify either:
>
> * an environment variable SQUEAK_SWAPMOUSE
> * a commandline argument -swapmouse
That's a very good solution!
So everyone can be happy (but has to be aware of reading docs with the
classic convention).
>
> to get the meanings of buttons 2 and 3 swapped.
>
> I also fixed a typo in the name of an environment variable.
>
> I don't know whom I need to send this to, so I'm sending it
> to the list.
It's the right location.
Thank you,
Stephan
> Ned Konz
>
> --- sqXWindow.c Fri May 19 15:31:08 2000
> +++ sqXWindow.c.new Fri Jul 7 11:50:21 2000
> @@ -178,6 +178,7 @@
> int noTitle= 0;
> int fullScreen= 0;
> struct timeval startUpTime;
> +int swapMouseButtons = false; /* true if buttons 2 and 3 swapped */
>
> /* maximum input polling frequency */
> #define MAXPOLLSPERSEC 33
> @@ -1318,9 +1319,9 @@
>
> switch (theEvent->button)
> {
> - case 1: stButtons= 4; break;
> - case 2: stButtons= 2; break;
> - case 3: stButtons= 1; break;
> + case 1: stButtons= 4; break; /* Red */
> + case 2: stButtons= (swapMouseButtons ? 1 : 2); break; /* Yellow or
> (swapped) Blue */
> + case 3: stButtons= (swapMouseButtons ? 2 : 1); break; /* Blue or
> (swapped) Yellow */
> case 4: /* Mouse wheel support */
> case 5: keyBufAppend( (theEvent->button + 26) /* Up/Down */
> | (2 << 8) /* Ctrl */
> @@ -3076,6 +3077,7 @@
> #ifdef USE_XSHM
> printf(" -xshm use X shared memory extension\n");
> #endif
> + printf(" -swapmouse swap mouse buttons 2 and 3\n");
> printf("\nNotes:\n");
> printf(" <imageName> defaults to 'Squeak"SQVERSION".image'.\n");
> printf(" Using 'unix:0' for <dpy> may improve local display
> performance.\n");
> @@ -3137,7 +3139,7 @@
>
> /* defaults */
>
> - if ((ev= getenv("SQEEAK_ALIGN")))
> + if ((ev= getenv("SQUEAK_ALIGN")))
> asmAlign= atoi(ev);
> else
> asmAlign= 1;
> @@ -3182,6 +3184,8 @@
> if (getenv("SQUEAK_SECURE"))
> secure= 1;
>
> + swapMouseButtons = getenv("SQUEAK_SWAPMOUSE") ? true : false;
> +
> #if defined(USE_XSHM) && !defined(HEADLESS)
> if (getenv("SQUEAK_XSHM"))
> useXshm= 1;
> @@ -3366,6 +3370,15 @@
> exit(1);
> }
> secure= true;
> + continue;
> + }
> +
> + if (!strcmp(*argv, "-swapmouse"))
> + {
> + vmArgVec[vmArgCnt++]= *argv; /* Save as a VM arg */
> + argc--; /* skip -swapmouse */
> + argv++;
> + swapMouseButtons = true;
> continue;
> }
--
Stephan Rudlof (sr at evolgo.de)
"Genius doesn't work on an assembly line basis.
You can't simply say, 'Today I will be brilliant.'"
-- Kirk, "The Ultimate Computer", stardate 4731.3
More information about the Squeak-dev
mailing list
|