Subject: Re: Remap Mouse-Buttons in X
To: None <bsalai@servtech.com>
From: John P. Wittkoski <jpw@insoft.com>
List: port-mac68k
Date: 10/13/1995 11:32:35
[ Stephen B. "Brad" Salai said: ]

> I wonder if X is messing up the mapping? Having said this, I realize that
> it shouldn't be possible if the keyboard has been reinited, since in that
> case, the left and right hand keys would send the same code. Since they are
> clearly sending different key codes, either ADBReInit wasn't called, it was
> called but wasn't successful, or the keyboard was subsequently told to go
> back to different codes for left and right hand keys. If I understand you
> correctly, it would not be possible for xmodmap to mess up the left and
> right hand keys if they were sending the identical codes. Therefor at least
> in my case the codes MUST be different, and something must have told the
> keyboard to do this.

I think you are correct. X is probably NOT causing the problem. If the keyboard
sends left and right code as the same keycode, then X has no idea which side
they are from and really does not care. But if the keyboard is sending 
different codes for left and right, then the X server may not recognize the
right keycodes if they are not set up in X properly. 

However, I don't think using xmodmap will help. This is because I don't think
there is any way (at the X level) to xmodmap a key sequence into a mouse 
button press. In order to get around this, the code that does this is in the
ADB driver itself. If it catches a certain input from the keyboard, it
sends a mouse "keycode" instead. That is why the kernel needs to be recompiled
in order to provide this function. In the future, it may be possible to switch
which mode the keyboard is in by using an ioctl call, but it's not there quite
yet.

Xmodmap lets you do some neat things, like changing keys on a keyboard 
for different locales or nationalities, but can't (to my knowledge) map
keyboard keycodes to mouse "keycodes" at the X level. If anyone knows of 
a way to do this, then it would be much easier.

	--John

--
--------------------------------------------------------------
 John Wittkoski				InSoft, Inc.
 Senior Systems Engineer                Phone: (717) 730-9501
 Email: jpw@insoft.com                  Fax  : (717) 730-9504
--------------------------------------------------------------