Index: audacious-1.3.2/src/audacious/ui_main.c =================================================================== --- audacious-1.3.2.orig/src/audacious/ui_main.c 2007-04-04 23:44:05.000000000 -0700 +++ audacious-1.3.2/src/audacious/ui_main.c 2007-10-16 13:21:23.000000000 -0700 @@ -1220,6 +1220,16 @@ return TRUE; } +static void +mainwin_set_volume_abs(gint v) +{ + mainwin_adjust_volume_motion(v); + setting_volume = FALSE; + mainwin_set_volume_slider(v); + equalizerwin_set_volume_slider(v); + read_volume(VOLUME_SET); +} + static gboolean mainwin_keypress(GtkWidget * grab_widget, GdkEventKey * event, @@ -1232,13 +1242,35 @@ case GDK_Up: case GDK_KP_Up: case GDK_KP_8: + case 0x1008FF13: mainwin_set_volume_diff(2); break; case GDK_Down: case GDK_KP_Down: case GDK_KP_2: + case 0x1008FF11: mainwin_set_volume_diff(-2); break; + + /* mute */ + case 0x1008FF12: + { + static gint v=-1; + if(v <= 0) + { + gint vl,vr; + input_get_volume(&vl, &vr); + v=MAX(vl, vr); + mainwin_set_volume_abs(0); + } + else + { + mainwin_set_volume_abs(v); + v=-1; + } + } + break; + case GDK_Left: case GDK_KP_Left: case GDK_KP_7: @@ -1270,7 +1302,9 @@ case GDK_Escape: mainwin_minimize_cb(); break; + default: + /*fprintf(stderr, "GDK keycode: 0x%X\n", event->keyval);*/ return FALSE; } @@ -1849,11 +1883,7 @@ vol = MAX(vl, vr); vol = CLAMP(vol + diff, 0, 100); - mainwin_adjust_volume_motion(vol); - setting_volume = FALSE; - mainwin_set_volume_slider(vol); - equalizerwin_set_volume_slider(vol); - read_volume(VOLUME_SET); + mainwin_set_volume_abs(vol); } void