Emulate Double Click Events

Fernando Carrijo fcarrijo at yahoo.com.br
Sun Nov 23 04:50:50 PST 2008


On Sun, 2008-11-23 at 12:14 +0000, micki _ wrote:

> yes i read the following link.
> i will try to explain again:
> I am developing an X11 input driver for tablet.
> i have a problem with the double click option.
> when i double click an icon on my desktop ( To run an application) 
> is sometimes it work.
> I would like to know how to implements double click events.

So allow me to try to explain it more clearly...

The whole idea of double-clicks does not exist in server side. Input
devices generate interrupts, that get translated by their respective
drivers into events (e.g. button presses and releases), which in turn
are placed into the event queue to be sent to interested clients.

The analysis of incoming events in search of double-clicks is
responsibility of the toolkit used to code the client, being not
constant across different toolkits.

So, if I recall correctly, GTK considers as double-clicks those
sequences of "press + release + press + release" whose maximum timestamp
difference is 250 milliseconds. In the case of Qt, the situation is a
little bit different: its default behavior under X11 is to consider as
double-clicks that sequence of events which are separated 400
milliseconds apart; something which might not be the same while under
Windows.

By the way, those are _default_ values, and virtually every toolkit
offers a convenient API through which they can be altered. For this very
reason I posted the link on the other message. Just take some time to
google for the properties mentioned there, and you will see that this is
simpler than seems to be!  :)

Cheers,
Fernando




More information about the xorg mailing list