Wallstreet Week in Review: Mouse Buttons

Clinton MacDonald yellowdog-newbie@lists.terrasoftsolutions.com
Sun, 17 Aug 2003 14:17:14 -0500


Friends:

Earlier, I complained about right and middle button emulation on my  
Wallstreet PowerBook G3 series. Finally, I have succeeded in changing  
the mouse button emulation permanently to my liking:

In another thread, on Friday, August 15, 2003, at 07:21  PM, Clinton  
MacDonald wrote:
> On Friday, August 15, 2003, at 01:11  PM, Longman, Bill wrote:
>> You know of the F-key trick, no?
>> F10 = Middle
>> F11 = Right
>
> I tried the Yellow Dog How-To on emulating the second and third mouse  
> buttons:
> <http://www.yellowdoglinux.com/support/solutions/general/ 
> mouseemu.shtml>

So, my goal is to change permanently the mouse button emulation for the  
Wallstreet. Obviously, it would be a hardship to carry around a spare  
three-button mouse just so that I could use Linux on a laptop. Since  
the Wallstreet keyboard has a lovely "function" (fn) key at the bottom  
left of the keyboard, I thought I would make "fn-splat" emulate a  
right-click and "fn-opt" emulate a middle-click. However, editing the  
file "/etc/sysconfig/mouse" as recommended in the How-To (above) had  
absolutely no effect. Darn!

To update the emulation on-the-fly (i.e., until the next reboot), the  
How-To correctly pointed out that I could type the commands (after "su"  
as root):

[root@localhost clint]$ /sbin/sysctl -w  
dev.mac_hid.mouse_button3_keycode=126
[root@localhost clint]$ /sbin/sysctl -w  
dev.mac_hid.mouse_button2_keycode=100

(I had previously determined that "126" was the keycode for "fn-splat"  
and "100" for "fn-opt" as stated in the How-To.)

Having setup my mouse emulation to fn-splat" and "fn-opt," I was as  
happy as a fly in a jelly jar. This combination could be accessed with  
one hand, and was similar enough to the "command-click" of the  
Macintosh OS that I had plenty of "muscle memory" of its use. It was  
just great, birds were chirping, and I was very happy, until...

I rebooted -- and everything went back to the defaults (F10 and F11).  
Darn.

Editing "/etc/sysconfig/mouse" did not make these changes permanent.  
The YDL How-To is completely wrong on this point. I could retype the  
command lines again after each reboot, but that was silly.

But then, I thought, maybe there had been some changes in YDL 3.0? If  
the changes were obvious enough, perhaps I could guess how to fix the  
problem. Here's what I did (my comments follow the # sign):

[clint@localhost clint]$ cd /etc/sysconfig #go to the sysconfig  
directory
[clint@localhost sysconfig]$ ls m*
mouse     mouse-emulation   #only two files in /etc/sysconfig start  
with the letter "m"
[clint@localhost sysconfig]$ cat mouse #my single favorite command of  
all time :-)
FULLNAME="Apple - Trackpad"
MOUSETYPE="imps2"
XEMU3="no"
XMOUSETYPE="IMPS/2"
DEVICE=/dev/input/mice
EMU_BUT2=100 #no effect
EMU_BUT3=126 #no effect

Obviously, YDL 3.0 was no longer using this file to configure the mouse  
button emulation. But, how about the other "m" file?

[clint@localhost clint]$ cat mouse-emulation
...
# Mouse Button 2 (default: F10)
BUTTON_2=68
# Mouse Button 3 (default: F11)
BUTTON_3=87

Aha! This looked like what I wanted. I logged in as root ("su"), then  
chose pico to edit /etc/sysconfig/mouse-emulation. All I did was  
comment-out the likely lines, and enter my new defaults for mouse  
button 2 (middle click) and mouse button 3 (right click):

[root@localhost clint]$ pico /etc/sysconfig/mouse-emulation
...
# Mouse Button 2 (default: F10)
#BUTTON_2=68
BUTTON_2=100
# Mouse Button 3 (default: F11)
#BUTTON_3=87
BUTTON_3=126

After a reboot, everything was just perfect, and all was right with the  
world.

Let me tell you, choosing a better emulation for right- and  
middle-button clicking has made a world of difference in my use of  
Linux on the PowerBook! Already, I am using more of the installed Linux  
programs and am looking forward to exploring more. I picture making the  
Wallstreet my "beater" machine, and using it to write drafts of  
manuscripts, grants, etc. I figured out how to transfer files from my  
main "axe," my Titanium PowerBook G4 using SSH and Fugu (more on that  
in another Wallstreet Review :-) ), and that will make everything  
easier.

Until next time!

[clint@localhost clint]$ /sbin/snooze #ZZZZZZZZZ :-)

Best wishes,
Clint

-- 
Dr. Clinton C. MacDonald | <mailto:clint.macdonald@ttuhsc.edu>