Re: tilt/horizontal scroll support

2008-08-15 Thread Andriy Gapon
on 13/08/2008 19:29 Rui Paulo said the following:
 
 Well, perhaps the best way is to teach sysmouse about horizontal scrolling
 and then add a quirk WRT your mouse ?
 
 sysmouse(4) really needs to grow horizontal scrolling since nowadays every
 mouse has it.

Rui,

I agree, this would be a perfect solution.
What scares me is backward compatibility. I think that I do not
understand how to do it right. So that older userland software works
with newer kernels and newer userland works with older kernels.
As I understand there are interfaces of hardware mouse drivers, then
there is moused, then there is sysmouse interface and then there are
user applications like X server.
Knowledge of horizontal scrolling needs to be added to all components in
the chain and it is better be done in backward-compatible fashion.
And I really do not know to do this properly.
Would it be just adding some new bytes to the protocol or growing a new
protocol (level) or something else...

P.S. I replaced usb ml with arch@ in cc.

-- 
Andriy Gapon
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


tilt/horizontal scroll support

2008-08-13 Thread Andriy Gapon

I have the following mouse:
http://www.logitech.com/index.cfm/partners/system_builders_integrators/products/mice/devices/3141cl=gb,en#

It has Tilt Wheel Plus Zoomâ„¢ technology, i.e. its scroll wheel can be
tilted left and right. Currently it perfectly works as 3 buttons + wheel
mouse, but tilting action does not cause any effect (in xev).

This is some debug output from ums driver:
ums0: Logitech USB-PS/2 Optical Mouse, rev 2.00/27.20, addr 2, iclass 3/1
ums0: 8 buttons and Z dir.
ums_attach: sc=0xff004d747400
ums_attach: X  8/8
ums_attach: Y  16/8
ums_attach: Z  24/8
ums_attach: B1 0/1
ums_attach: B2 1/1
ums_attach: B3 2/1
ums_attach: B4 3/1
ums_attach: B5 4/1
ums_attach: B6 5/1
ums_attach: B7 6/1
ums_attach: B8 7/1

Here's how normal/vertical scrolling of the wheel is reported by ums
(one scroll forward and one scroll backward):
ums_intr: sc=0xff006b502400 status=0
ums_intr: data = 00 00 00 ff 00
ums_intr: x:0 y:0 z:1 t:0 buttons:0x0
ums_intr: sc=0xff006b502400 status=0
ums_intr: data = 00 00 00 01 00
ums_intr: x:0 y:0 z:-1 t:0 buttons:0x0
As expected value in the 4th byte (data[3]) is interpreted as z-axis
movement (and seems to always be +1/-1).

Here's how tilting of the wheel is reported (tilted the wheel, held it
for some time and then released):
ums_intr: sc=0xff004d747400 status=0
ums_intr: data = 00 00 00 00 01
ums_intr: x:0 y:0 z:0 t:0 buttons:0x0
ums_intr: sc=0xff004d747400 status=0
ums_intr: data = 00 00 00 00 01
ums_intr: x:0 y:0 z:0 t:0 buttons:0x0
ums_intr: sc=0xff004d747400 status=0
ums_intr: data = 00 00 00 00 01
ums_intr: x:0 y:0 z:0 t:0 buttons:0x0
ums_intr: sc=0xff004d747400 status=0
ums_intr: data = 00 00 00 00 00
ums_intr: x:0 y:0 z:0 t:0 buttons:0x0

It seems that tilting is reported by value in the 5th byte (data[4]), it
has hardware auto-repeat and end of tilting is reported by all-zeroes
data. Currently, it seems, data[4] is completely ignored.

I would like to get tilting to work as horizontal scrolling in X, using
SysMouse protocol.
As I understand currently our sysmouse(4) protocol doesn't provide for
tilting data (there is no field for it in the packet structure), and
Xorg sysmouse driver does not have any support for tilting either.

So now I have two questions.
1. What would be the best way to each ums about the tilt capability of
this mouse? Is there some generic way to detect it or maybe
logitech-specific way or some model-specific quirk is required?

2. What would be the best way to pass tilting data to consumers?
I see two possibilities:
A) map data[4] to some extended button value (do it in ums driver), e.g.
to button 6 and button 7;
B) it seems that dz value is always 1 or -1, amount of scrolling affects
number of mouse events, but abs(dz) is always 1; if this is really
always true, then tilting could be piggy-backed onto dz as +2/-2 value
(or some such) and then Xorg sysmouse driver could be taught to
interpret such values as special button presses (similarly to how
vertical scrolling is handled in it).

Thank you in advance for advices and opinions.

-- 
Andriy Gapon
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tilt/horizontal scroll support

2008-08-13 Thread Rui Paulo
On Wed, Aug 13, 2008 at 06:41:45PM +0300, Andriy Gapon wrote:
 
 I have the following mouse:
 http://www.logitech.com/index.cfm/partners/system_builders_integrators/products/mice/devices/3141cl=gb,en#

...

 So now I have two questions.
 1. What would be the best way to each ums about the tilt capability of
 this mouse? Is there some generic way to detect it or maybe
 logitech-specific way or some model-specific quirk is required?
 
 2. What would be the best way to pass tilting data to consumers?
 I see two possibilities:
 A) map data[4] to some extended button value (do it in ums driver), e.g.
 to button 6 and button 7;
 B) it seems that dz value is always 1 or -1, amount of scrolling affects
 number of mouse events, but abs(dz) is always 1; if this is really
 always true, then tilting could be piggy-backed onto dz as +2/-2 value
 (or some such) and then Xorg sysmouse driver could be taught to
 interpret such values as special button presses (similarly to how
 vertical scrolling is handled in it).

Well, perhaps the best way is to teach sysmouse about horizontal scrolling
and then add a quirk WRT your mouse ?

sysmouse(4) really needs to grow horizontal scrolling since nowadays every
mouse has it.

Regards,
-- 
Rui Paulo
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]