[PATCH] add keypad w/numlock events to main window
Cal Peake <[email protected]>
| Newsgroups | gmane.comp.multimedia.xmms.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, The attached patch adds keypad keypress events when numlock is on for the main XMMS window. IOW, make XMMS act like Winamp as far as the keypad goes. Summary of the additions: '.' = jump to song '0' = load file '1' = jump 10 songs back in playlist '2' = volume down '3' = jump 10 songs forward in playlist '4' = last song '5' = play '6' = next song '7' = rewind 10 secs '8' = volume up '9' = fast-forward 10 secs Patch is against CVS as of 27 Nov 2004. Please consider for application. thanks, -- Cal _______________________________________________ xmms-devel mailing list [email protected] http://lists.xmms.org/mailman/listinfo/xmms-devel
keypad.patch
(text/plain, 1.6 KB)
--- xmms/xmms/main.c 2004-05-22 18:26:47.000000000 -0400
+++ xmms-1/xmms/main.c 2004-11-27 10:52:10.000000000 -0500
@@ -112,6 +112,7 @@
void mainwin_options_menu_callback(gpointer cb_data, guint action, GtkWidget * w);
void mainwin_volume_motioncb(gint pos);
static void set_timer_mode_menu_cb(TimerMode mode);
+static void mainwin_jump_to_file(void);
enum
{
@@ -1404,22 +1405,47 @@
{
case GDK_Up:
case GDK_KP_Up:
+ case GDK_KP_8:
mainwin_set_volume_diff(2);
break;
case GDK_Down:
case GDK_KP_Down:
+ case GDK_KP_2:
mainwin_set_volume_diff(-2);
break;
case GDK_Left:
case GDK_KP_Left:
+ case GDK_KP_7:
if(playlist_get_current_length() != -1)
input_seek(CLAMP(input_get_time() - 5000, 0, playlist_get_current_length()) / 1000);
break;
case GDK_Right:
case GDK_KP_Right:
+ case GDK_KP_9:
if(playlist_get_current_length() != -1)
input_seek(CLAMP(input_get_time() + 5000, 0, playlist_get_current_length()) / 1000);
break;
+ case GDK_KP_0:
+ mainwin_eject_pushed();
+ break;
+ case GDK_KP_1:
+ playlist_set_position((((get_playlist_position() - 10) >= 0) ? get_playlist_position() - 10 : 0));
+ break;
+ case GDK_KP_3:
+ playlist_set_position((((get_playlist_position() + 10) < get_playlist_length()) ? (get_playlist_position() + 10) : (get_playlist_length() - 1)));
+ break;
+ case GDK_KP_4:
+ playlist_prev();
+ break;
+ case GDK_KP_5:
+ mainwin_play_pushed();
+ break;
+ case GDK_KP_6:
+ playlist_next();
+ break;
+ case GDK_KP_Decimal:
+ mainwin_jump_to_file();
+ break;
default:
break;