From 54c9257f28f6ecb8cbbef0215357a62e2dfe4731 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 27 Jan 2012 09:46:51 +0000 Subject: [PATCH] docs: Update to show the symbolic button names https://bugzilla.gnome.org/show_bug.cgi?id=668692 --- doc/cookbook/events.xml | 12 +++++++++--- doc/cookbook/examples/animations-scaling-zoom.c | 4 ++-- doc/reference/clutter/clutter-sections.txt | 3 +++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/cookbook/events.xml b/doc/cookbook/events.xml index 150c59a3e..44d60ad6b 100644 --- a/doc/cookbook/events.xml +++ b/doc/cookbook/events.xml @@ -1274,16 +1274,22 @@ g_object_set (settings, - 1 = left mouse button + 1 = left mouse button in a right-handed configuration, + or the right mouse button in a left-handed configuration - 2 = scroll wheel + 2 = scroll wheel button - 3 = right mouse button + 3 = right mouse button in a right-handed configuration, + or the left mouse button in a left-handed configuration + Clutter provides symbolic names for the three buttons + above: CLUTTER_BUTTON_PRIMARY, CLUTTER_BUTTON_MIDDLE, and + CLUTTER_BUTTON_SECONDARY. + For mice with more buttons, or other types of input devices, the mappings may not be so straightforward: you may have to experiment to see diff --git a/doc/cookbook/examples/animations-scaling-zoom.c b/doc/cookbook/examples/animations-scaling-zoom.c index aa051c4bb..79c899ed5 100644 --- a/doc/cookbook/examples/animations-scaling-zoom.c +++ b/doc/cookbook/examples/animations-scaling-zoom.c @@ -55,9 +55,9 @@ clicked_cb (ClutterActor *actor, clutter_actor_get_scale (actor, &scale, NULL); - if (button == 1) + if (button == CLUTTER_BUTTON_PRIMARY) scale *= 1.2; - else if (button == 3) + else if (button == CLUTTER_BUTTON_SECONDARY) scale /= 1.2; /* don't do anything if scale is outside bounds */ diff --git a/doc/reference/clutter/clutter-sections.txt b/doc/reference/clutter/clutter-sections.txt index c3f450ffa..789f945dd 100644 --- a/doc/reference/clutter/clutter-sections.txt +++ b/doc/reference/clutter/clutter-sections.txt @@ -1107,6 +1107,9 @@ clutter_event_put clutter_events_pending +CLUTTER_BUTTON_PRIMARY +CLUTTER_BUTTON_MIDDLE +CLUTTER_BUTTON_SECONDARY clutter_event_set_button clutter_event_get_button clutter_event_get_click_count