View Single Post
  #43   Report Post  
Posted to rec.crafts.metalworking
Jim Wilkins[_2_] Jim Wilkins[_2_] is offline
external usenet poster
 
Posts: 5,888
Default Solar Powered Garage Door Opener.

"DoN. Nichols" wrote in message
...
On 2017-03-20, Jim Wilkins wrote:

40:17 and 40:18 show the current up or pressed state of the
non-printing control keys. I checked them when my programs asked
the
user to "press any key" and flashed the screen alarmingly when some
joker pressed Shift.


What about if the joker decided to spell out "any". :-)


Each key press would be parsed immediately as a command or operand.

I wrote a replacement key input function that didn't wait for Enter.
It returned one 1-or-2-byte character from the keyboard buffer or 0 if
it was empty and let the main program loop continue, thus it could
detect Escape or any other key including F1-12, and the program could
also check other inputs and read in commands stored in a macro file
and still exit if the user hit ESC.

It worked pretty well for a hardware control progam with few real-time
commands where the keyboard wasn't in a good typing position.
-jsw.