Computer Science Canada

getting around getch

Author:  Nitro [ Sat Jan 11, 2003 11:42 am ]
Post subject:  getting around getch

hello. I am wondering if there is a way to get around the problems with the getch command. when directing a character on the screen, I want the program to detect if a key is being pressed. if not, then just keep executing the program as normal. I know something similar can be done with the Mouse.Where command, but I have yet to figure out a way to do this with the keyboard. please help.

Author:  Brightguy [ Sat Jan 11, 2003 12:47 pm ]
Post subject:  Re: getting around getch

You mean something like:

code:
var key : string (1)

loop
    if hasch then
          getch (key)
          exit when key = "x"
    end if
end loop


Nothing fancy here. Just exits when user presses "x".


: