Index: trunk/Ohana/src/kii/picture/cursor.c
===================================================================
--- trunk/Ohana/src/kii/picture/cursor.c	(revision 3464)
+++ trunk/Ohana/src/kii/picture/cursor.c	(revision 5349)
@@ -10,5 +10,5 @@
   int             status;
   XComposeStatus  composestatus;
-  char            string[10], line[500];
+  char            string[10], line[40], *name;
   double          x, y;
   
@@ -35,9 +35,7 @@
     if (LastEvent (display, MotionNotify,    &event)) UpdatePointer (graphic, layout, (XMotionEvent *) &event);
     if (LastEvent (display, ButtonPress,     &event)) InterpretPresses (graphic, layout, (XButtonEvent *) &event);
-
     if (LastEvent (display, KeyPress,        &event)) {
       status = XLookupString ((XKeyEvent *) &event, string, 9, &keysym, &composestatus);
 
-      if (!status) continue;
       if (event.xkey.x < layout[0].picture.x) continue;
       if (event.xkey.x > layout[0].picture.x + layout[0].picture.dx) continue;
@@ -46,11 +44,25 @@
 	
       Screen_to_Image (&x, &y, (double)event.xkey.x, (double)event.xkey.y, layout);
+      name = XKeysymToString (keysym);
 
-      if (isprint(string[0]))
-	sprintf (line, "%c %6.1f %6.1f ", string[0], x, y);
-      else {
-	sprintf (line, "X %6.1f %6.1f ", x, y);
-      }
-      write (layout[0].Ximage, line, 16);
+      // skip the following keys: 
+      if (!strcmp (name, "Shift_L")) continue;
+      if (!strcmp (name, "Shift_R")) continue;
+      if (!strcmp (name, "Control_L")) continue;
+      if (!strcmp (name, "Control_R")) continue;
+      if (!strcmp (name, "Alt_L")) continue;
+      if (!strcmp (name, "Alt_R")) continue;
+      if (!strcmp (name, "Super_L")) continue;
+      if (!strcmp (name, "Super_R")) continue;
+      if (!strcmp (name, "Caps_Lock")) continue;
+      if (!strcmp (name, "Pause")) continue;
+      if (!strcmp (name, "Continue")) continue;
+      if (!strcmp (name, "Num_Lock")) continue;
+      if (!strcmp (name, "Scroll_Lock")) continue;
+      if (!strcmp (name, "Print")) continue;
+      if (!strcmp (name, "(null)")) continue;
+
+      snprintf (line, 40, "%12s %12.6f %12.6f ", name, x, y);
+      write (layout[0].Ximage, line, 40);
     }
   }
