Example #1
0
/*!
  \brief logviewer generic button event handler
  \param widget is the pointer to button
  \param data is unused
  \returns TRUE
  */
G_MODULE_EXPORT gboolean logviewer_button_event(GtkWidget *widget, gpointer data)
{
	Lv_Handler handler;
	GtkWidget *tmpwidget = NULL;
	handler = (Lv_Handler)(GINT)OBJ_GET(widget,"handler");
	switch(handler)
	{
		case LV_GOTO_START:
			tmpwidget = lookup_widget("logviewer_log_position_hscale");
			if (GTK_IS_RANGE(tmpwidget))
				gtk_range_set_value(GTK_RANGE(tmpwidget),0.0);
			break;
		case LV_GOTO_END:
			tmpwidget = lookup_widget("logviewer_log_position_hscale");
			if (GTK_IS_RANGE(tmpwidget))
				gtk_range_set_value(GTK_RANGE(tmpwidget),100.0);
			break;
		case LV_PLAY:
			start_tickler(LV_PLAYBACK_TICKLER);
			break;
		case LV_STOP:
			stop_tickler(LV_PLAYBACK_TICKLER);
			break;
		case LV_REWIND:
			printf("rewind\n");
			break;
		case LV_FAST_FORWARD:
			printf("fast forward\n");
			break;
		default:
			break;

	}
	return TRUE;
}
void
test_scale (gconstpointer data)
{
    GtkWidget *scale;
    gint widget_value;
    gint xinput_value;
    const gchar *widget_name;
    const gchar *xinput_name;
    const gchar *box_name;

    widget_name = gcut_data_get_string(data, "widget-name");
    xinput_name = gcut_data_get_string(data, "xinput-name");
    box_name = gcut_data_get_string(data, "box-name");

    enable_widget(box_name);

    scale = get_widget(widget_name);
    cut_assert_true(GTK_IS_RANGE(scale));

    xinput_value = get_int_property_of_xinput(xinput_name);
    widget_value = gtk_test_slider_get_value(scale);
    cut_assert_equal_int(xinput_value, widget_value);

    gtk_test_slider_set_perc(scale, 50.0);
    wait_action();
    xinput_value = get_int_property_of_xinput(xinput_name);
    widget_value = gtk_test_slider_get_value(scale);
    cut_assert_equal_int(xinput_value, widget_value);
}
int
mn_non_linear_range_get_value (GtkRange *range)
{
  RangeInfo *info;
  int raw;
  int offset = 0;
  int i;

  g_return_val_if_fail(GTK_IS_RANGE(range), -1);

  info = get_info(range);

  raw = (int) gtk_range_get_value(range);

  for (i = 0; i < info->num_blocks; i++)
    {
      const MNNonLinearRangeBlock *block = &info->blocks[i];
      int next_offset;

      next_offset = offset + get_block_len(block);

      if (raw >= offset && raw < next_offset)
	return block->min + (raw - offset) * block->step;

      offset = next_offset;
    }

  g_assert_not_reached();
  return -1;
}
void
mn_non_linear_range_setup_static (GtkRange *range,
				  const MNNonLinearRangeBlock *blocks,
				  int num_blocks)
{
  RangeInfo *info;
  int i;
  int num_values = 0;

  g_return_if_fail(GTK_IS_RANGE(range));
  g_return_if_fail(blocks != NULL);
  g_return_if_fail(num_blocks > 0);

  global_init();

  info = g_new0(RangeInfo, 1);
  info->blocks = blocks;
  info->num_blocks = num_blocks;

  g_object_set_qdata_full(G_OBJECT(range), info_quark, info, g_free);

  for (i = 0; i < num_blocks; i++)
    num_values += get_block_len(&blocks[i]);

  gtk_range_set_range(range, 0, num_values - 1);
}
Example #5
0
static gboolean slider_callback(gpointer data) {
  struct slider_callback_data *cbd = (struct slider_callback_data*)data;
  if (GTK_IS_RANGE(cbd->range))
    gtk_range_set_value(cbd->range,cbd->val);
  free(cbd);
  return FALSE; // don't keep calling
}
/*
 * If the value is not found in the blocks, the nearest existing value
 * will be used.
 */
void
mn_non_linear_range_set_value (GtkRange *range, int value)
{
  g_return_if_fail(GTK_IS_RANGE(range));

  gtk_range_set_value(range, value_to_index(get_info(range), value));
}
Example #7
0
/**
 * gtk_test_slider_get_value:
 * @widget:     valid widget pointer.
 *
 * Retrive the literal adjustment value for GtkRange based
 * widgets and spin buttons. Note that the value returned by
 * this function is anything between the lower and upper bounds
 * of the adjustment belonging to @widget, and is not a percentage
 * as passed in to gtk_test_slider_set_perc().
 *
 * Returns: gtk_adjustment_get_value (adjustment) for an adjustment belonging to @widget.
 *
 * Since: 2.14
 **/
double
gtk_test_slider_get_value (GtkWidget *widget)
{
    GtkAdjustment *adjustment = NULL;
    if (GTK_IS_RANGE (widget))
        adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
    else if (GTK_IS_SPIN_BUTTON (widget))
        adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
    return adjustment ? gtk_adjustment_get_value (adjustment) : 0;
}
Example #8
0
/*!
  \brief set_logviewer_mode() sets things up for playback mode
  \param mode Enumeration defining the logviewr mode (live or playback)
  */
G_MODULE_EXPORT void set_logviewer_mode(Lv_Mode mode)
{
	GtkWidget *widget = NULL;

	reset_logviewer_state();
	free_log_info(DATA_GET(global_data,"log_info"));
	if (mode == LV_PLAYBACK)
	{
		DATA_SET(global_data,"playback_mode",GINT_TO_POINTER(TRUE));
		gtk_widget_set_sensitive(lookup_widget("logviewer_select_logfile_button"), TRUE);
		gtk_widget_set_sensitive(lookup_widget("logviewer_select_params_button"), FALSE);
		gtk_widget_hide(lookup_widget("logviewer_rt_control_vbox1"));
		/* This one should NOT be enabled until at least 1 var is selected */
		gtk_widget_show(lookup_widget("logviewer_playback_control_vbox1"));
		gtk_widget_show(lookup_widget("scroll_speed_vbox"));

		widget = lookup_widget("logviewer_log_position_hscale");
		if (GTK_IS_RANGE(widget))
			gtk_range_set_value(GTK_RANGE(widget),0.0);
		hue = -60.0;
		col_sat = 1.0;
		col_val = 1.0;
	}
	else if (mode == LV_REALTIME)
	{
		enable_playback_controls(FALSE);

		stop_tickler(LV_PLAYBACK_TICKLER);
		DATA_SET(global_data,"playback_mode",GINT_TO_POINTER(FALSE));
		gtk_widget_set_sensitive(lookup_widget("logviewer_select_logfile_button"), FALSE);
		gtk_widget_set_sensitive(lookup_widget("logviewer_select_params_button"), TRUE);
		gtk_widget_show(lookup_widget("logviewer_rt_control_vbox1"));
		gtk_widget_hide(lookup_widget("logviewer_playback_control_vbox1"));
		gtk_widget_hide(lookup_widget("scroll_speed_vbox"));
		widget = lookup_widget("logviewer_log_position_hscale");
		if (GTK_IS_RANGE(widget))
			gtk_range_set_value(GTK_RANGE(widget),100.0);
		hue = -60.0;
		col_sat = 1.0;
		col_val = 1.0;
	}
}
/**
 * gtk_test_slider_set_perc
 * @widget:     valid widget pointer.
 * @percentage: value between 0 and 100.
 *
 * This function will adjust the slider position of all GtkRange
 * based widgets, such as scrollbars or scales, it'll also adjust
 * spin buttons. The adjustment value of these widgets is set to
 * a value between the lower and upper limits, according to the
 * @percentage argument.
 *
 * Since: 2.14
 **/
void
gtk_test_slider_set_perc (GtkWidget      *widget,
                          double          percentage)
{
  GtkAdjustment *adjustment = NULL;
  if (GTK_IS_RANGE (widget))
    adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
  else if (GTK_IS_SPIN_BUTTON (widget))
    adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
  if (adjustment)
    gtk_adjustment_set_value (adjustment, adjustment->lower + (adjustment->upper - adjustment->lower - adjustment->page_size) * percentage * 0.01);
}
static RangeInfo *
get_info (GtkRange *range)
{
  RangeInfo *info;

  g_return_val_if_fail(GTK_IS_RANGE(range), NULL);
  g_return_val_if_fail(info_quark != 0, NULL);

  info = g_object_get_qdata(G_OBJECT(range), info_quark);
  g_return_val_if_fail(info != NULL, NULL);

  return info;
}
Example #11
0
void fConnectCB(::GtkWidget* pWidget, gpointer data)
{
	if(GTK_IS_RANGE(pWidget))
	{
		g_signal_connect(G_OBJECT(pWidget), "value-changed", G_CALLBACK(fScrollCB), (gpointer) g_iAnalogCount);
		g_iAnalogCount++;
	}

	if(GTK_IS_TOGGLE_BUTTON(pWidget))
	{
		g_signal_connect(G_OBJECT(pWidget), "toggled", G_CALLBACK(fSwitchCB), (void*)g_iButtonCount);
		g_iButtonCount++;
	}
}
Example #12
0
/* Setting '/min-notification-timeout' changed either at widget or at xfconf property */
static void _xfdashboard_settings_widget_changed_notification_timeout(XfdashboardSettings *self, GtkRange *inRange)
{
	XfdashboardSettingsPrivate		*priv;
	guint							value;

	g_return_if_fail(XFDASHBOARD_IS_SETTINGS(self));
	g_return_if_fail(GTK_IS_RANGE(inRange));

	priv=self->priv;

	/* Get value from widget */
	value=floor(gtk_range_get_value(inRange)*1000);

	/* Set value at xfconf property */
	xfconf_channel_set_uint(priv->xfconfChannel, "/min-notification-timeout", value);
}
gboolean focus_in_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
{
    (void)event;
    if ( IS_EGE_ADJUSTMENT_ACTION(data) ) {
        EgeAdjustmentAction* action = EGE_ADJUSTMENT_ACTION( data );
        if ( GTK_IS_SPIN_BUTTON(widget) ) {
            action->private_data->lastVal = gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) );
#if GTK_CHECK_VERSION(2,12,0)
        } else if ( GTK_IS_SCALE_BUTTON(widget) ) {
            action->private_data->lastVal = gtk_scale_button_get_value( GTK_SCALE_BUTTON(widget) );
#endif /* GTK_CHECK_VERSION(2,12,0) */
        } else if (GTK_IS_RANGE(widget) ) {
            action->private_data->lastVal = gtk_range_get_value( GTK_RANGE(widget) );
        }
        action->private_data->transferFocus = TRUE;
    }

    return FALSE; /* report event not consumed */
}
Example #14
0
/* Add widget to map for container */
static void *
blofeld_knobs_container_add_widget(void *knobmap_in,
                                   struct knob_descriptor *knob_description)
{
  struct knobmap *knobmap = knobmap_in;

  if (!knob_description) return knobmap;

  if (GTK_IS_RANGE(knob_description->widget))
    knobmap->pots.build = g_list_prepend(knobmap->pots.build,
                                         knob_description);
  else if (GTK_IS_COMBO_BOX(knob_description->widget))
    knobmap->buttons.build = g_list_prepend(knobmap->buttons.build,
                                            knob_description);
  /* We don't map toggle buttons or check buttons as it messes up the
   * ordering in for example the oscillator frames. */

  return knobmap;
}
Example #15
0
/* This function makes up for some brokeness in gtkrange.c
 * where we never get the full arrow of the stepper button
 * and the type of button in a single drawing function.
 *
 * It doesn't work correctly when the scrollbar is squished
 * to the point we don't have room for full-sized steppers.
 */
static void
reverse_engineer_stepper_box (GtkWidget    *range,
			      GtkArrowType  arrow_type,
			      gint         *x,
			      gint         *y,
			      gint         *width,
			      gint         *height)
{
  gint slider_width = 14, stepper_size = 14;
  gint box_width;
  gint box_height;
  
  if (range && GTK_IS_RANGE (range))
    {
      gtk_widget_style_get (range,
			    "slider_width", &slider_width,
			    "stepper_size", &stepper_size,
			    NULL);
    }
	
  if (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN)
    {
      box_width = slider_width;
      box_height = stepper_size;
    }
  else
    {
      box_width = stepper_size;
      box_height = slider_width;
    }

  *x = *x - (box_width - *width) / 2;
  *y = *y - (box_height - *height) / 2;
  *width = box_width;
  *height = box_height;
}
Example #16
0
/*!
 \brief convert_temps() changes the values of controls based on the currently
 selected temperature scale.  IT works for labels, spinbuttons, etc...
 \param widget (gpointer) pointer to the widget that contains the necessary
 paramaters re temp (Alt label, etc)
 \param units (gpointer) the temp scale selected
 */
G_MODULE_EXPORT void convert_temps(gpointer widget, gpointer units)
{
	static void (*update_widget_f)(gpointer, gpointer);
	static gboolean (*check_deps)(gconstpointer *) = NULL;
	gconstpointer *dep_obj = NULL;
	gfloat upper = 0.0;
	gfloat lower = 0.0;
	gfloat value = 0.0;
	gchar * text = NULL;
	GtkAdjustment * adj = NULL;
	gboolean state = FALSE;
	gint widget_temp = -1;
	/*extern GdkColor black;*/
	extern gconstpointer *global_data;

	/* If this widgt depends on anything call check_dependancy which will
	 * return TRUE/FALSE.  True if what it depends on is in the matching
	 * state, FALSE otherwise...
	 */
	if ((!widget) || (DATA_GET(global_data,"leaving")))
		return;
	if (!check_deps)
		if (!get_symbol("check_dependancies",(void *)&check_deps))
			dbg_func(CRITICAL|CONVERSIONS,g_strdup_printf(__FILE__": convert_temps()\n\tCan NOT locate \"check_dependancies\" function pointer in plugins, BUG!\n"));
	if (!update_widget_f)
		if(!get_symbol("update_widget",(void *)&update_widget_f))
			dbg_func(CRITICAL|CONVERSIONS,g_strdup_printf(__FILE__": convert_temps()\n\tCan NOT locate \"update_widget\" function pointer in plugins, BUG!\n"));
	dep_obj = (gconstpointer *)OBJ_GET(widget,"dep_object");
	widget_temp = (GINT)OBJ_GET(widget,"widget_temp");
	if (dep_obj)
	{
		if (check_deps)
			state = check_deps(dep_obj);
		else
			dbg_func(CRITICAL|CONVERSIONS,g_strdup_printf(__FILE__": convert_temps()\n\tWidget %s has dependant object bound but can't locate function ptr for \"check_dependancies\" from plugins, BUG!\n",glade_get_widget_name(widget)));
	}

	switch ((TempUnits)units)
	{
		case FAHRENHEIT:
			/*printf("fahr %s\n",glade_get_widget_name(widget));*/
			if (GTK_IS_LABEL(widget))
			{
				if ((dep_obj) && (state))	
					text = (gchar *)OBJ_GET(widget,"alt_f_label");
				else
					text = (gchar *)OBJ_GET(widget,"f_label");
				gtk_label_set_text(GTK_LABEL(widget),text);
				//gtk_widget_modify_text(widget,GTK_STATE_NORMAL,&black);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));

			}
			if ((GTK_IS_SPIN_BUTTON(widget)) && (widget_temp != FAHRENHEIT))
			{

				adj = (GtkAdjustment *) gtk_spin_button_get_adjustment(
						GTK_SPIN_BUTTON(widget));
				upper = adj->upper;
				value = adj->value;
				lower = adj->lower;
				if (widget_temp == CELSIUS)
				{
					adj->value = c_to_f(value);
					adj->lower = c_to_f(lower);
					adj->upper = c_to_f(upper);
				}
				else /* Previous is kelvin */
				{
					adj->value = k_to_f(value);
					adj->lower = k_to_f(lower);
					adj->upper = k_to_f(upper);
				}

				gtk_adjustment_changed(adj);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
				update_widget_f(widget,NULL);
			}
			if ((GTK_IS_ENTRY(widget)) && (widget_temp != FAHRENHEIT))
			{
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
				update_widget_f(widget,NULL);
			}
			if ((GTK_IS_RANGE(widget)) && (widget_temp != FAHRENHEIT))
			{
				adj = (GtkAdjustment *) gtk_range_get_adjustment(
						GTK_RANGE(widget));
				upper = adj->upper;
				lower = adj->lower;
				value = adj->value;
				if (widget_temp == CELSIUS)
				{
					adj->value = c_to_f(value);
					adj->lower = c_to_f(lower);
					adj->upper = c_to_f(upper);
				}
				else /* Previous is kelvin */
				{
					adj->value = k_to_f(value);
					adj->lower = k_to_f(lower);
					adj->upper = k_to_f(upper);
				}

				gtk_range_set_adjustment(GTK_RANGE(widget),adj);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
			}
			break;
		case CELSIUS:
			/*printf("fahr %s\n",glade_get_widget_name(widget));*/
			if (GTK_IS_LABEL(widget))
			{
				if ((dep_obj) && (state))	
					text = (gchar *)OBJ_GET(widget,"alt_c_label");
				else
					text = (gchar *)OBJ_GET(widget,"c_label");
				gtk_label_set_text(GTK_LABEL(widget),text);
				//gtk_widget_modify_text(widget,GTK_STATE_NORMAL,&black);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));

			}
			if ((GTK_IS_SPIN_BUTTON(widget)) && (widget_temp != CELSIUS))
			{

				adj = (GtkAdjustment *) gtk_spin_button_get_adjustment(
						GTK_SPIN_BUTTON(widget));
				upper = adj->upper;
				value = adj->value;
				lower = adj->lower;
				if (widget_temp == FAHRENHEIT)
				{
					adj->value = f_to_c(value);
					adj->lower = f_to_c(lower);
					adj->upper = f_to_c(upper);
				}
				else /* Previous is kelvin */
				{
					adj->value = k_to_c(value);
					adj->lower = k_to_c(lower);
					adj->upper = k_to_c(upper);
				}

				gtk_adjustment_changed(adj);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
				update_widget_f(widget,NULL);
			}
			if ((GTK_IS_ENTRY(widget)) && (widget_temp != CELSIUS))
			{
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
				update_widget_f(widget,NULL);
			}
			if ((GTK_IS_RANGE(widget)) && (widget_temp != CELSIUS))
			{
				adj = (GtkAdjustment *) gtk_range_get_adjustment(
						GTK_RANGE(widget));
				upper = adj->upper;
				lower = adj->lower;
				value = adj->value;
				if (widget_temp == FAHRENHEIT)
				{
					adj->value = f_to_c(value);
					adj->lower = f_to_c(lower);
					adj->upper = f_to_c(upper);
				}
				else /* Previous is kelvin */
				{
					adj->value = k_to_c(value);
					adj->lower = k_to_c(lower);
					adj->upper = k_to_c(upper);
				}

				gtk_range_set_adjustment(GTK_RANGE(widget),adj);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
			}
			break;
		case KELVIN:
			/*printf("fahr %s\n",glade_get_widget_name(widget));*/
			if (GTK_IS_LABEL(widget))
			{
				if ((dep_obj) && (state))	
					text = (gchar *)OBJ_GET(widget,"alt_k_label");
				else
					text = (gchar *)OBJ_GET(widget,"k_label");
				gtk_label_set_text(GTK_LABEL(widget),text);
				//gtk_widget_modify_text(widget,GTK_STATE_NORMAL,&black);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));

			}
			if ((GTK_IS_SPIN_BUTTON(widget)) && (widget_temp != KELVIN))
			{

				adj = (GtkAdjustment *) gtk_spin_button_get_adjustment(
						GTK_SPIN_BUTTON(widget));
				upper = adj->upper;
				value = adj->value;
				lower = adj->lower;
				if (widget_temp == FAHRENHEIT)
				{
					adj->value = f_to_k(value);
					adj->lower = f_to_k(lower);
					adj->upper = f_to_k(upper);
				}
				else /* Previous is celsius */
				{
					adj->value = c_to_k(value);
					adj->lower = c_to_k(lower);
					adj->upper = c_to_k(upper);
				}

				gtk_adjustment_changed(adj);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
				update_widget_f(widget,NULL);
			}
			if ((GTK_IS_ENTRY(widget)) && (widget_temp != KELVIN))
			{
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
				update_widget_f(widget,NULL);
			}
			if ((GTK_IS_RANGE(widget)) && (widget_temp != KELVIN))
			{
				adj = (GtkAdjustment *) gtk_range_get_adjustment(
						GTK_RANGE(widget));
				upper = adj->upper;
				lower = adj->lower;
				value = adj->value;
				if (widget_temp == FAHRENHEIT)
				{
					adj->value = f_to_k(value);
					adj->lower = f_to_k(lower);
					adj->upper = f_to_k(upper);
				}
				else /* Previous is celsius */
				{
					adj->value = c_to_k(value);
					adj->lower = c_to_k(lower);
					adj->upper = c_to_k(upper);
				}

				gtk_range_set_adjustment(GTK_RANGE(widget),adj);
				OBJ_SET(widget,"widget_temp",GINT_TO_POINTER(units));
			}
			break;
	}
}
/**
key_press_cb:
**/
static gboolean
key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
{
  gboolean digested = FALSE;

  ///g_return_val_if_fail(IS_INDICATOR_SOUND(data), FALSE);

  ///IndicatorSound *indicator = INDICATOR_SOUND (data);

  ///IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(indicator);
  AppletData *priv = myDataPtr;
  GtkWidget *menuitem;
  ///menuitem = get_current_item (GTK_CONTAINER (widget));
  menuitem = gtk_menu_shell_get_selected_item (GTK_MENU_SHELL (widget));

  if (IDO_IS_SCALE_MENU_ITEM(menuitem) == TRUE){
    gdouble current_value = 0;
    gdouble new_value = 0;
    const gdouble five_percent = 5;
    gboolean is_voip_slider = FALSE;

    if (g_ascii_strcasecmp (ido_scale_menu_item_get_primary_label (IDO_SCALE_MENU_ITEM(menuitem)), "VOLUME") == 0) {
      g_debug ("vOLUME SLIDER KEY PRESS");
      GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
      GtkWidget* slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)slider_widget);
      GtkRange* range = (GtkRange*)slider;
      g_return_val_if_fail(GTK_IS_RANGE(range), FALSE);
      current_value = gtk_range_get_value(range);
      new_value = current_value;
    }
    else if (g_ascii_strcasecmp (ido_scale_menu_item_get_primary_label (IDO_SCALE_MENU_ITEM(menuitem)), "VOIP") == 0) {
      g_debug ("VOIP SLIDER KEY PRESS");
      GtkWidget* slider_widget = voip_input_widget_get_ido_slider(VOIP_INPUT_WIDGET(priv->voip_widget));
      GtkWidget* slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)slider_widget);
      GtkRange* range = (GtkRange*)slider;
      g_return_val_if_fail(GTK_IS_RANGE(range), FALSE);
      current_value = gtk_range_get_value(range);
      new_value = current_value;
      is_voip_slider = TRUE;
    }

    switch (event->keyval) {
    case GDK_KEY_Right:
      digested = TRUE;
      new_value = current_value + five_percent;
      break;
    case GDK_KEY_Left:
      digested = TRUE;
      new_value = current_value - five_percent;
      break;
    case GDK_KEY_plus:
      digested = TRUE;
      new_value = current_value + five_percent;
      break;
    case GDK_KEY_minus:
      digested = TRUE;
      new_value = current_value - five_percent;
      break;
    default:
      break;
    }
    new_value = CLAMP(new_value, 0, 100);
    if (new_value != current_value){
      if (is_voip_slider == TRUE){
        voip_input_widget_update (VOIP_INPUT_WIDGET(priv->voip_widget), new_value);
      }
      else{
        volume_widget_update (VOLUME_WIDGET(priv->volume_widget), new_value, "keypress-update");
      }
    }
  }
  else if (IS_TRANSPORT_WIDGET(menuitem) == TRUE) {
    TransportWidget* transport_widget = NULL;
    GList* elem;

    for ( elem = priv->transport_widgets_list; elem; elem = elem->next ) {
      transport_widget = TRANSPORT_WIDGET ( elem->data );
      if ( transport_widget_is_selected( transport_widget ) ) 
        break;
    }

    switch (event->keyval) {
    case GDK_KEY_Right:
      transport_widget_react_to_key_press_event ( transport_widget,
                                                  TRANSPORT_ACTION_NEXT );
      digested = TRUE;
      break;        
    case GDK_KEY_Left:
      transport_widget_react_to_key_press_event ( transport_widget,
                                                  TRANSPORT_ACTION_PREVIOUS );
      digested = TRUE;
      break;
    case GDK_KEY_space:
      transport_widget_react_to_key_press_event ( transport_widget,
                                                  TRANSPORT_ACTION_PLAY_PAUSE );
      digested = TRUE;
      break;
    case GDK_KEY_Up:
    case GDK_KEY_Down:
      digested = FALSE;
      break;
    default:
      break;
    }
  } 
  return digested;
}