Re: inputing from keyboard

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

if you input or get key can you put a full sentence in a data base and check against known words

Yes, I don't see why you couldn't use get_key() to do that.

If you do use get_key(), you must put it inside a fairly tight loop, as the function does not wait until you're finished typing to proceed on, so a tight loop would insure that you get all keypresses. And you'd have to save each keypress in an accumulating variable, and constantly test every keypress for <enter>/<return> in order to exit the loop and proceed to your use or test of the accumulated input.

You probably should also put the keypresses onto the screen, so that if a key IS missed, it could be noticed by the user.

The resulting sequence of keypresses, if you saved them to a variable correctly, would certainly be able to be stored in a data base, though if you're checking against known words, I'd think you might want to do that checking before putting it in there, in case you need to advise the user to repeat their input, though your specific intended purpose may validly suggest otherwise.

And you'd want to clear the variable you used to accumulate the keypresses quickly, in case more keypresses are presented.

Dan

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

Search



Quick Links

User menu

Not signed in.

Misc Menu