linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* pre8(vger) kills button 3 on 1-button mouse
  1999-01-20 22:20 3-button mouse Benjamin Herrenschmidt
@ 1999-01-21  9:34 ` Martin Costabel
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Costabel @ 1999-01-21  9:34 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Benjamin Herrenschmidt


The latest changes for 2-to-4-button mice on vger in
drivers/macintosh/mac_keyb.c (rev 1.24) break the emulation of button 3
on my 1-button Apple adb mouse.

This happens both in Xpmac, where option_right+click is hard-coded to
button 3, and in XF68_FBDev, where I use a patch by Franz Sirl for the
adb_buttons kernel command to get the same effect.

The reason seems to be that in rev 1.24 option_right gets mapped to
option_left even in raw mode (same for ctrl, BTW). I don't understand
this from the code, which is too complicated for me, anyway, but from
looking at the effect, as witnessed by xev in Xpmac, for example.

For the moment, I went back to rev 1.23 which doesn't have this problem.

--
Martin

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pre8(vger) kills button 3 on 1-button mouse
@ 1999-01-21 11:58 Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 1999-01-21 11:58 UTC (permalink / raw)
  To: Martin Costabel, bh40, linuxppc-dev


On Thu, Jan 21, 1999, Martin Costabel <costabel@wanadoo.fr> wrote:

>The latest changes for 2-to-4-button mice on vger in
>drivers/macintosh/mac_keyb.c (rev 1.24) break the emulation of button 3
>on my 1-button Apple adb mouse.
>
>This happens both in Xpmac, where option_right+click is hard-coded to
>button 3, and in XF68_FBDev, where I use a patch by Franz Sirl for the
>adb_buttons kernel command to get the same effect.
>
>The reason seems to be that in rev 1.24 option_right gets mapped to
>option_left even in raw mode (same for ctrl, BTW). I don't understand
>this from the code, which is too complicated for me, anyway, but from
>looking at the effect, as witnessed by xev in Xpmac, for example.
>
>For the moment, I went back to rev 1.23 which doesn't have this problem.

I removed most of my patches to mac_keyb.c before submitting them, I was
pretty sure I didn't break anything, but I was probably wrong. I'll have
a look at it as soon as I manage to get this vger tree (today probably)
and submit a new patch.

Here, I have rewritten most of the buttons handling in console and
buttons emulation, but my new version is not ready and was not included
in the patches I sent to Cort. I just checked my patches, and they should
not change anything to buttons emulation. I'll test all this later today.
Thanks for pointing this out.

Ah yes, could you send me a dmesg log ? I would like to soo how your
mouse was recognized at startup.


-- 
           E-Mail: <mailto:bh40@calva.net>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>





[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pre8(vger) kills button 3 on 1-button mouse
       [not found] <36A733F6.79E148C7@univ-rennes1.fr>
@ 1999-01-22 10:44 ` Benjamin Herrenschmidt
  1999-01-22 18:30   ` Martin Costabel
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 1999-01-22 10:44 UTC (permalink / raw)
  To: costabel, linuxppc-dev, cort


Ok, I found the reason why the keyboard is no longer sending different
keycodes for left and right option key. In my patches, I was setting the
keyboard to the highest possible handler ID for a normal keyboard (that
is 3 or 5 instead of 1) but this is wrong: at handler 5, the Apple
Extended Keyboard will not send different codes.

The kernel fix is in mac_keyb.c, line 647, replace:

	/* Enable full feature set of the keyboard
	   ->get it to send separate codes for left and right shift,
	   control, option keys */
	for(i = 0;i < keyboard_ids.nids; i++) {
	    if (adb_try_handler_change(keyboard_ids.id[i], 5))
	    	printk("ADB keyboard at %d, handler set to 5\n", keyboard_ids.id[i]);
	    else if (adb_try_handler_change(keyboard_ids.id[i], 3))
	    	printk("ADB keyboard at %d, handler set to 3\n", keyboard_ids.id[i]);
	    else
	    	printk("ADB keyboard at %d, handler 1\n", keyboard_ids.id[i]);
	}

by

	/* Enable full feature set of the keyboard
	   ->get it to send separate codes for left and right shift,
	   control, option keys */
	for(i = 0;i < keyboard_ids.nids; i++) {
    if (adb_try_handler_change(keyboard_ids.id[i], 3))
	    	printk("ADB keyboard at %d, handler set to 3\n", keyboard_ids.id[i]);
	    else
	    	printk("ADB keyboard at %d, handler 1\n", keyboard_ids.id[i]);
	}


In the meantime, you can get back the previous behaviour from userland with:

mousemode 2 3

Sorry for the inconvenient !




[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pre8(vger) kills button 3 on 1-button mouse
  1999-01-22 10:44 ` pre8(vger) kills button 3 on 1-button mouse Benjamin Herrenschmidt
@ 1999-01-22 18:30   ` Martin Costabel
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Costabel @ 1999-01-22 18:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, cort


Benjamin Herrenschmidt wrote:
> 
> Ok, I found the reason why the keyboard is no longer sending different
> keycodes for left and right option key. 

It works! Thanks.

--
Martin

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-01-22 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <36A733F6.79E148C7@univ-rennes1.fr>
1999-01-22 10:44 ` pre8(vger) kills button 3 on 1-button mouse Benjamin Herrenschmidt
1999-01-22 18:30   ` Martin Costabel
1999-01-21 11:58 Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
1999-01-20 22:20 3-button mouse Benjamin Herrenschmidt
1999-01-21  9:34 ` pre8(vger) kills button 3 on 1-button mouse Martin Costabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).