# include <kapa_internal.h>

int KiiCursorOn (int fd) {
  write (fd, "CURS", 4); /* ask Source to look for the keystrokes */
  return (TRUE);
}

int KiiCursorOff (int fd) {
  write (fd, "NCUR", 4); /* ask Source to look for the keystrokes */
  return (TRUE);
}

int KiiCursorRead (int fd, double *x, double *y, char *key) {

  char buffer[40];

  bzero (buffer, 40);
  read (fd, buffer, 40);
  buffer[39] = 0;

  sscanf (buffer, "%s %lf %lf", key, x, y);
  if (ispunct(key[0])) strcpy (key, "_");

  return (TRUE);
}
