Re: Newbie Question
- Posted by euphoric (admin) Mar 26, 2009
- 805 views
Trixar_za said...
I want to read from the input without stopping the process - how can I do this?
You'll need to put a get_key() inside your polling loop (get_key() doesn't wait for input). For example (pseudo-code):
while 1 do x = get_key() if x = RETURN_KEY then process(word) elsif x = DELETE_KEY word = word[1..$-1] elsif x = ESC_KEY then exit -- exits the primary polling/processing loop else word &= x end if process_mud_stuff() end while