Re: putitng info from keyboard

new topic     » goto parent     » topic index » view thread      » older message » newer message
fred said...

is there a way to set a time limit

You'd have to write your own input function that uses get_key() to watch for keyboard and collect it in a sequence, while also monitoring the time passed since it started monitoring. Then when the time passed a certain point, it would exit its loop and continue on.

fred said...

or have it randomised

Or have what randomized? The input from the user? The time limit?

fred said...

so is the sentence saved in key

get_key() and wait_key() only return the key pressed:

integer key 
 
key = wait_key() 
printf( 1, "%s\n", key ) 


So if I press the 'K' key, that would simply output:

K 


-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu