Re: keyboard input from ISIS

From: John E. Davis <davis_at_email.domain.hidden>
Date: Fri, 26 Oct 2007 21:27:26 +0000
rgibson_at_email.domain.hidden> I want to capture keystrokes from the keyboard.  (I wasn't clear... not trying
> to save to a log file.)  I want to do something a bit interactive, like:
>
> while (key = getkey() != 'Q') {
>    if (key = 'P') () = printf("Hello\n");
>    ...
>}

isis> .load ./getkey.sl
isis> x = getkey ();   
isis> !cat getkey.sl
define getkey ()
{
   () = system ("stty raw");
   variable ch;
   if (1 != read (fileno(stdin), &ch, 1))
     ch = 0;
   () = system ("stty sane");
   return ch;
}

--John
----
You received this message because you are
subscribed to the isis-users list.
To unsubscribe, send a message to
isis-users-request_at_email.domain.hiddenwith the first line of the message as:
unsubscribe
Received on Fri Oct 26 2007 - 21:27:40 EDT

This archive was generated by hypermail 2.3.0 : Fri May 02 2014 - 08:35:45 EDT