View Single Post
  #45   Report Post  
Posted to rec.crafts.metalworking
DoN. Nichols[_2_] DoN. Nichols[_2_] is offline
external usenet poster
 
Posts: 2,584
Default Also no lonber ( Solar Powered Garage Door Opener.)

On 2017-03-21, Jim Wilkins wrote:
"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.


O.K. No option for that, then.

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.


And on a lab bench, that is a common situation.

Enjoy,
DoN.

--
Remove oil spill source from e-mail
Email: | (KV4PH) Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---