Fix bad mouse

Haoyu Bai divinekid at gmail.com
Thu Aug 21 03:58:19 PDT 2008


Hi,

I'm interesting in how to implement such a feature, as the software
described in this page: http://www.cnbeta.com/articles/38865.htm

It is a Chinese page. For those can't read Chinese, this page describe
a Win32 software, which fixes some mouse cause the system recognize a
single click as double click. It did so by detecting two succession
mouse click events that fall into a very short time gap, and then
cancel the second one - which is a false event caused by the mouse's
circuit.

My question is, how to implement such a feature in X? One possible way
is to hack the mouse driver, but this could made this feature
unportable, because there are many mouse drivers. The second way is to
write a X11 client program which grab all button events, and then
block false events and resend the true events. I tried the second way,
but encountered some problem: I use XGrabButton() to grab events, and
then ungrab, then resend them using the XTest extension, but finally I
received the event I was sent, and that usually caused an infinite
loop.

So, any suggestion? Which is the better way to implement such a feature?

Thanks!
-- 
Haoyu Bai



More information about the xorg mailing list