Exemple #1
0
static gint keypress (GtkWidget* widget, GdkEventKey* event, gpointer data)
{
  unsigned int code = gdk_keyval_to_upper(event->keyval);

  if (code == GDK_Escape)
  {
    gtk_widget_destroy (g_pToolWnd);
    g_pToolWnd = NULL;
    return TRUE;
  }

  if (CanProcess ())
  {
    if (g_2DView.OnKeyDown (code))
      return FALSE;

    if (code == GDK_Return)
    {
      Textool_Validate();
      return FALSE;
    }
  }

  return TRUE;
}
bool CWindowListener::OnKeyPressed( char *s ){
	if ( !strcmp( s,"Escape" ) ) {
		Textool_Cancel();
		return TRUE;
	}
	if ( CanProcess() ) {
		if ( g_2DView.OnKeyDown( s ) ) {
			return TRUE;
		}

		if ( !strcmp( s,"Return" ) ) {
			Textool_Validate();
			return TRUE;
		}
	}
	return FALSE;
}