GNOME Bugzilla – Bug 316257
forward / back mouse buttons should trigger next / previous songs
Last modified: 2009-11-29 12:33:43 UTC
I think it would be a good feature if rhythm box picked up the forward and backward mouse buttons and used them to control which song is playing.
Adding to this, it would be nice if you could just hover the mouse over the tray icon and side click to go back and forward between songs.
(In reply to comment #0) > I think it would be a good feature if rhythm box picked up the forward and > backward mouse buttons and used them to control which song is playing. The best thing to do is to make those buttons emit Alt-Left and Alt-Right. As those are the standard Back and Forward shortcuts, it should work in most programs (including Rhythmbox). (In reply to comment #1) > Adding to this, it would be nice if you could just hover the mouse over the > tray icon and side click to go back and forward between songs. This would be fairly difficult, as different mice have them as different button numbers. Some mice (mouse-wheel + back/forward button) have them as buttons 6/7, others have them as 8/9 (some with extra buttons). I'm not sure if we can really do this in a way that doesn't do weird things with different mice.
Well, scrolling the mouse wheel over the system tray icon lowers and raises the volume, I don't see how adding the side buttons there would be any different than that. It would make rhythmbox much more convenient for multitasking users - just move the mouse to the icon and give a side click, and the song is changed! People with different mouse buttons use different xmodmap and xserver settings anyway, so, you could just make the controls triggered by the same buttons that other programs use. As long as it follows the same convention that other programs are using (such as galeon, firefox, thunar), users would not have much of a problem.
The standard is to make them emit Alt-Left and Alt-Right. If you have a recent (at least 0.9.3 iirc) version of Rhythmbox, they should work in the main window. The problem with doing it over the tray icon, is that (afaik) tray icons don't get keyboard events - so we can't respond to Alt-Arrows.
Created attachment 147710 [details] [review] Patch for handing back/foward mouse clicks while over system tray icon Handles back/forward mouse buttons while hovering over system tray icon. A "previous button" click will go to the previous song, while a "next button" click will go to the next song. A very slick to change songs! Does not interfere with the scroll wheel or right or left clicking.
Comment on attachment 147710 [details] [review] Patch for handing back/foward mouse clicks while over system tray icon >diff -Naur rhythmbox-0.12.5.orig/plugins/status-icon/rb-status-icon-plugin.c rhythmbox-0.12.5/plugins/status-icon/rb-status-icon-plugin.c >--- rhythmbox-0.12.5.orig/plugins/status-icon/rb-status-icon-plugin.c 2009-09-16 14:04:49.000000000 -0700 >+++ rhythmbox-0.12.5/plugins/status-icon/rb-status-icon-plugin.c 2009-11-13 19:21:20.000000000 -0800 >@@ -281,6 +281,12 @@ > rb_tray_icon_menu_popup (plugin->priv->tray_icon, popup, 3); > g_object_unref (ui_manager); > break; >+ case 8: >+ rb_shell_player_do_previous(plugin->priv->shell_player, NULL); >+ break; >+ case 9: >+ rb_shell_player_do_next(plugin->priv->shell_player, NULL); >+ break; > } > } >
Created attachment 147711 [details] [review] Patch for handing back/foward mouse clicks while over system tray icon Handles back/forward mouse buttons while hovering over system tray icon. A "previous button" click will go to the previous song, while a "next button" click will go to the next song. A very slick to change songs! Does not interfere with the scroll wheel or right or left clicking. I messed up the last patch, it had a bunch of extra debian stuff in it. This one doesn't.
Review of attachment 147711 [details] [review]: ::: rhythmbox-0.12.5.orig/plugins/status-icon/rb-status-icon-plugin.c @@ +282,3 @@ g_object_unref (ui_manager); break; + case 8: where does the number 8 come from here? is the 8th mouse button always 'previous'? is the 'previous' mouse button always the 8th? @@ +283,3 @@ break; + case 8: + rb_shell_player_do_previous(plugin->priv->shell_player, NULL); needs to be a space between the function and its arguments @@ +285,3 @@ + rb_shell_player_do_previous(plugin->priv->shell_player, NULL); + break; + case 9: same as above
Buttons 8 and 9 are almost always the defaults for the back and forward buttons. If they are not, most distrubutions/howtos and wikis recommend remapping them to 8/9 via xmodmap. Nautilus, firefox and file-roller count buttons 8 and 9 as the forward and back buttons.
Created attachment 147833 [details] [review] Added spaces before function names
committed as 9a982259f8c7b1e4733dac5fcbdd3c2560387637