[pinpoint] Extra keyboard and mouse bindings
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pinpoint] Extra keyboard and mouse bindings
- Date: Sun, 18 Mar 2012 00:43:05 +0000 (UTC)
commit 577ed9bc62b65cf7a16413433cd36d07475ae89f
Author: VladimÃr Kincl <kincl vlada gmail com>
Date: Sat Mar 17 15:20:20 2012 -0300
Extra keyboard and mouse bindings
H/h/Home: first slide, mouse clicks: next/previous
Signed-off-by: Antonio Terceiro <terceiro softwarelivre org>
https://bugzilla.gnome.org/show_bug.cgi?id=671377
pp-clutter.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/pp-clutter.c b/pp-clutter.c
index c86dd0a..0f7dbec 100644
--- a/pp-clutter.c
+++ b/pp-clutter.c
@@ -199,6 +199,9 @@ static void stage_resized (ClutterActor *actor,
static gboolean key_pressed (ClutterActor *actor,
ClutterEvent *event,
ClutterRenderer *renderer);
+static gboolean mouse_clicked (ClutterActor *actor,
+ ClutterEvent *event,
+ ClutterRenderer *renderer);
static void
pp_clutter_render_adjust_background (ClutterRenderer *renderer,
@@ -755,6 +758,8 @@ clutter_renderer_init_speaker_screen (ClutterRenderer *renderer)
g_signal_connect (renderer->speaker_screen, "key-press-event",
G_CALLBACK (key_pressed), renderer);
+ g_signal_connect (renderer->speaker_screen, "button-press-event",
+ G_CALLBACK (mouse_clicked), renderer);
@@ -888,6 +893,8 @@ clutter_renderer_init (PinPointRenderer *pp_renderer,
G_CALLBACK (stage_deleted), renderer);
g_signal_connect (stage, "key-press-event",
G_CALLBACK (key_pressed), renderer);
+ g_signal_connect (stage, "button-press-event",
+ G_CALLBACK (mouse_clicked), renderer);
g_signal_connect (stage, "notify::width",
G_CALLBACK (stage_resized), renderer);
@@ -1444,10 +1451,34 @@ key_pressed (ClutterActor *actor,
else
clutter_actor_show (renderer->curtain);
break;
+ case CLUTTER_H:
+ case CLUTTER_h:
+ case CLUTTER_Home:
+ start (NULL, NULL, renderer);
+ break;
}
return TRUE;
}
+static gboolean
+mouse_clicked (ClutterActor *actor,
+ ClutterEvent *event,
+ ClutterRenderer *renderer)
+{
+ if(event)
+ switch (clutter_event_get_button(event))
+ {
+ case 1: /* Left mouse button is clicked */
+ next_slide (renderer);
+ break;
+ case 3: /* Right mouse button is clicked */
+ prev_slide (renderer);
+ break;
+ }
+ return TRUE;
+}
+
+
static void leave_slide (ClutterRenderer *renderer,
gboolean backwards)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]