Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: Re: [Ethereal-dev] Re: TCP graphs for ethereal

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Thu, 8 Mar 2001 20:51:22 -0800
On Sat, Feb 24, 2001 at 04:17:02PM -0800, Guy Harris wrote:
> An additional problem:
> 
> 	#include <X11/keysym.h>
> 
> Ethereal is both a Windows and a UNIX/X11 application, so it'd need to
> handle raw keystrokes through GDK, not through any explicit access to X.

	...

> so you're not supposed to compare "event->keyval" against X keysym XK_
> values, you're supposed to compare them against GDK_ key values from
> <gdk/gdkkeysym.h>; that should work on X11, Windows, or any platforms
> that might be supported by GTK+ in the future.

This patch should fix that:

*** gtk/tcp_graph.c.orig	Thu Mar  8 01:18:09 2001
--- gtk/tcp_graph.c	Thu Mar  8 20:47:17 2001
***************
*** 6,11 ****
--- 6,12 ----
  #endif
  
  #include <gtk/gtk.h>
+ #include <gdk/gdkkeysyms.h>
  #include <stdio.h>
  #include <math.h>			/* rint() */
  
***************
*** 16,22 ****
  /*#include <netinet/tcp.h>*/	/* struct tcphdr & comp. */
  #include <netinet/in.h>		/* ntohs(), IPPROTO_TCP */
  #include <arpa/inet.h>		/* inet_ntoa() */
- #include <X11/keysym.h>
  
  #include "globals.h" 		/* cfile */
  #include "packet.h"			/* frame_data */
--- 17,22 ----
***************
*** 2778,2784 ****
  		toggle_time_origin (g);
  	else if (event->keyval == 's')
  		toggle_seq_origin (g);
! 	else if (event->keyval == XK_Shift_L) {
  //		g->zoom.flags |= ZOOM_OUT;
  		gtk_toggle_button_set_active (g->zoom.widget.out_toggle, TRUE);
  	}
--- 2778,2784 ----
  		toggle_time_origin (g);
  	else if (event->keyval == 's')
  		toggle_seq_origin (g);
! 	else if (event->keyval == GDK_Shift_L) {
  //		g->zoom.flags |= ZOOM_OUT;
  		gtk_toggle_button_set_active (g->zoom.widget.out_toggle, TRUE);
  	}
***************
*** 2795,2801 ****
  		if (g->toplevel == widget)
  			break;
  
! 	if (event->keyval == XK_Shift_L || event->keyval == XK_ISO_Prev_Group) {
  //		g->zoom.flags &= ~ZOOM_OUT;
  		gtk_toggle_button_set_active (g->zoom.widget.in_toggle, TRUE);
  	}
--- 2795,2801 ----
  		if (g->toplevel == widget)
  			break;
  
! 	if (event->keyval == GDK_Shift_L || event->keyval == GDK_ISO_Prev_Group) {
  //		g->zoom.flags &= ~ZOOM_OUT;
  		gtk_toggle_button_set_active (g->zoom.widget.in_toggle, TRUE);
  	}