tag 572354 +patch
thank you

Hello,

I reopened this bug because the mouse interaction was missing. It
appears that the new upstream version has a similar feature.

However, here is a patch that applies on 1.1.1-3 and provides this
feature (left click / scroll down go to the next slide, and right
click / scroll up go to the previous slide).

Thanks
Etienne Millon
--- a/src/classes/fullscreen_window.vala
+++ b/src/classes/fullscreen_window.vala
@@ -57,6 +57,7 @@
             this.size_allocate.connect( this.on_size_allocate );
 
             this.add_events(EventMask.POINTER_MOTION_MASK);
+            this.add_events(EventMask.BUTTON_PRESS_MASK);
             this.motion_notify_event += this.on_mouse_move;
 
             // Start the 5 seconds timeout after which the mouse curosr is
--- a/src/classes/presentation_controller.vala
+++ b/src/classes/presentation_controller.vala
@@ -71,6 +71,34 @@
         }
 
         /**
+         * Handle button presses to each of the controllables
+         */
+        public void button_press( Gdk.EventButton btn ) {
+            switch( btn.button ) {
+                case 1:  /* Left button */
+                    this.controllables_next_page();
+                break;
+                case 3: /* Right button */
+                    this.controllables_previous_page();
+                break;
+            }
+        }
+
+        /**
+         * Handle button presses to each of the controllables
+         */
+        public void scroll( Gdk.EventScroll scr ) {
+            switch( scr.direction ) {
+                case Gdk.ScrollDirection.DOWN:
+                    this.controllables_next_page();
+                break;
+                case Gdk.ScrollDirection.UP:
+                    this.controllables_previous_page();
+                break;
+            }
+        }
+
+        /**
          * Register a new Controllable instance on this controller. 
          *
          * On success true is returned, in case the controllable has already been
--- a/src/classes/presentation_window.vala
+++ b/src/classes/presentation_window.vala
@@ -71,12 +71,14 @@
             );
 
             this.key_press_event += this.on_key_pressed;
+            this.button_press_event += this.on_button_pressed;
+            this.scroll_event += this.on_scroll;
 
             this.reset();
         }
 
         /**
-         * Handle keypress events on the window and, if neccessary send them to the
+         * Handle keypress events on the window and, if necessary send them to the
          * presentation controller
          */
         protected bool on_key_pressed( PresentationWindow source, EventKey key ) {
@@ -85,6 +87,28 @@
             }
             return false;
         }
+
+        /**
+         * Handle button press events on the window and, if necessary send them to the
+         * presentation controller
+         */
+        protected bool on_button_pressed( PresentationWindow source, EventButton btn ) {
+            if ( this.presentation_controller != null ) {
+                this.presentation_controller.button_press( btn );
+            }
+            return false;
+        }
+
+        /**
+         * Handle scroll events on the window and, if necessary send them to the
+         * presentation controller
+         */
+        protected bool on_scroll( PresentationWindow source, EventScroll scr ) {
+            if ( this.presentation_controller != null ) {
+                this.presentation_controller.scroll( scr );
+            }
+            return false;
+        }
 
         /**
          * Set the presentation controller which is notified of keypresses and
--- a/src/classes/presenter_window.vala
+++ b/src/classes/presenter_window.vala
@@ -147,12 +147,14 @@
             );
 
             this.key_press_event += this.on_key_pressed;
+            this.button_press_event += this.on_button_pressed;
+            this.scroll_event += this.on_scroll;
 
             this.reset();
         }
 
         /**
-         * Handle keypress events on the window and, if neccessary send them to the
+         * Handle keypress events on the window and, if necessary send them to the
          * presentation controller
          */
         protected bool on_key_pressed( PresenterWindow source, EventKey key ) {
@@ -161,6 +163,28 @@
             }
             return false;
         }
+
+        /**
+         * Handle button press events on the window and, if necessary send them to the
+         * presentation controller
+         */
+        protected bool on_button_pressed( PresenterWindow source, EventButton btn ) {
+            if ( this.presentation_controller != null ) {
+                this.presentation_controller.button_press( btn );
+            }
+            return false;
+        }
+
+        /**
+         * Handle scroll events on the window and, if necessary send them to the
+         * presentation controller
+         */
+        protected bool on_scroll( PresenterWindow source, EventScroll scr ) {
+            if ( this.presentation_controller != null ) {
+                this.presentation_controller.scroll( scr );
+            }
+            return false;
+        }
 
         /**
          * Update the slide count view

Reply via email to