CompuServe Messages

#Amiga kbhit() & getch()

    27-Jul-94 16:17:54
Fm: Peter Wade 100265,2740
To: ron flory 71053,3551
If you are willing to work with a window and IDCMP you can request keyboard events to be sent to your window. Do you have the Amiga ROM Kernal Manuals? They explain this sort of thing very well. There is no direct equivalent to kbhit, but if you try and read a message from your IDCMP port and there isn't one there, there aren't any outstanding keyboard events for your window. In the Unix world if you want to do this sort of thing you have to change the setup of the port and the file. You do this using two function calls, ioctl and fcntl (I think you also have to use read instead of getch). ioctl can switch off buffering and local echo, and fcntl can put a file into "non-waiting" mode. If GNU has Unix compatible versions of these functions you may be able to use them. If you want any more information on these I can look them up at work. Peter Wade Autopiloting from London, England