[PATCH] xinput: Split XI2 valuators and print index of events

Peter Hutterer peter.hutterer at who-t.net
Thu Jul 1 18:17:00 PDT 2010


On Thu, Jul 01, 2010 at 06:36:42PM -0400, Chase Douglas wrote:
> XI2 events support bitmask selected valuators. When printing masked
> events, we need to also print the index of the valuator value. This
> change prints each valuator on its own line, prefixed by its index
> 
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
> ---
>  src/test_xi2.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/test_xi2.c b/src/test_xi2.c
> index 9ddb291..c59ba26 100644
> --- a/src/test_xi2.c
> +++ b/src/test_xi2.c
> @@ -65,13 +65,12 @@ static void print_deviceevent(XIDeviceEvent* event)
>      printf("    group: locked %#x latched %#x base %#x effective: %#x\n",
>              event->group.locked, event->group.latched,
>              event->group.base, event->group.effective);
> -    printf("    valuators:");
> +    printf("    valuators:\n");
>  
>      val = event->valuators.values;
>      for (i = 0; i < event->valuators.mask_len * 8; i++)
>          if (XIMaskIsSet(event->valuators.mask, i))
> -            printf(" %.2f", *val++);
> -    printf("\n");
> +            printf("        %i: %.2f\n", i, *val++);
>  
>      printf("    windows: root 0x%lx event 0x%lx child 0x%ld\n",
>              event->root, event->event, event->child);
> -- 
> 1.7.1

applied, thanks.

Cheers,
  Peter


More information about the xorg-devel mailing list