[MPlayer-dev-eng] [PATCH] Apple Remote support double click

Diego Biurrun diego at biurrun.de
Mon Sep 10 17:15:41 CEST 2007


On Sat, Aug 25, 2007 at 12:05:26AM +0800, Ulion wrote:
> 
> Here's a patch to support Apple Remote double click event, judged by a
> double click max difference time.
> 
> Original mp_input_ar_read function now become mp_input_ar_read_raw,
> and add a wrapper function as mp_input_ar_read to judge double click
> event.
> 
> Most useful usage come by the double click feature is double click to
> toggle fullscreen (in default cmd mapping).
> 
> --- input/ar.c	(revision 24142)
> +++ input/ar.c	(working copy)
> @@ -113,7 +115,16 @@
>  
> +static const float MAX_DCLICK_TIME_INTERVAL=0.33;

0.33 what?  Also, I faintly remember that we have a doubleclick interval
time somewhere, see -doubleclick-time.

> @@ -334,14 +349,28 @@
>  
> +    // We has to close and re-open the hid device once to make
> +    // system not response to the remote input.

We have to close and reopen the hid device once to make the system
not respond to the remote input.

> @@ -383,18 +421,217 @@
> +
> +int mp_input_ar_read(int fd)
> +{
> +    // Click down record is only for AR_VUP and AR_VDOWN.
> +    static int first_click_down = 0, second_click_down = 0;

What do you mean by "click down record" and click down?

> +    if (CHECK_DOUBLE_CLICK_EVENT) {
> +        switch (ret) {
> +            // These 2 keys have both press and release events.
> +            // Here we only handle press event, release event keeps going down.

"keeps going down"?

> +                        // Double click timeouted or key changed,

doubleclick, timed out

> +                        // Send the double click event.

doubleclick

> +                // We has click event and no input, check the interval.

"we" always goes with "have", never "has".

Diego



More information about the MPlayer-dev-eng mailing list