> I will see if I can try what Anatoly suggests.. :)

Use this simple prog to cough up the scancodes:

#include <stdio.h>
#include <sys/kbio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <termios.h>

void die(char *str) {
  perror(str);
  exit(0);
}

int main(void) {
  int err, mode;
  struct termios term_saved, term;
  int i;
  char ch;

  err = tcgetattr(0,&term);
  if(err==-1) die("tcgetattr");
 
  term_saved = term;
  cfmakeraw(&term);

  err = ioctl(0,KDGKBMODE, &mode);
  if(err==-1) die("getkbdmode");
  else printf("current kb mode: %d\n", mode);

  err = ioctl(0,KDSKBMODE, K_RAW);
  if(err==-1) die("setkbmode");
  else printf("K_RAW mode set\n");

  printf("Press Esc to end.\n");

  err = tcsetattr(0,TCSANOW,&term); /* set terminal to raw */
  if(err==-1) die("tcsetattr");

  for(i=0; i<1000; i++) {
        err=read(0,&ch,1);
        if(err!=1) break;
        printf("%d ",ch); fflush(stdout);
        if(ch==1) break; /* break on Escape */
  }

  err = tcsetattr(0,TCSANOW,&term_saved);
  if(err==-1) die("tcsetattr");

  err = ioctl(0,KDSKBMODE,mode);
  if(err==-1) die("setkbmode");
  else printf("\nkb mode restored\n");

}


-- 
Anatoly Vorobey,
[EMAIL PROTECTED] http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to