unwanted keypresses

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
grimaldiface
Posts: 43
Joined: Tue Apr 08, 2008 9:56 pm

unwanted keypresses

Post by grimaldiface » Thu Jul 31, 2008 6:49 pm

Im creating a learning program where the user studies some key terms and their definitions and then is tested on their memory for that question. On the study card, they are simply presented the materials. on the test card they are presented they key term and a response field. My problem is that, any accidental key presses that occur on the study card show up in the response field of the next card.

I have tried several measures to prevent this from happening, including setting the locktext to true,selecting empty, trapping keypresses in the response field, but these key presses from the previous card keep showing up.

When the test card is opened, I do the typical

Code: Select all

select text of fld response
put empty into fld response  
but those bastards keep getting put into the field.
Any ideas? I'm out.
Thanks a bunch,
Phil

grimaldiface
Posts: 43
Joined: Tue Apr 08, 2008 9:56 pm

Post by grimaldiface » Thu Jul 31, 2008 8:32 pm

okay, i sorta figured out what was wrong. in the remote chance anyone else runs into this problem, I think what happened was, during that study card, I was using the wait command to time the presentation of the materials. while the wait is happening it freezes all messages until after the defined time runs up. i dont know exactly what happens but for some reason when the time ran up it just dumped those keypresses that occured during the wait. to fix, i used the "wait with messages" command instead.

helentam
Posts: 4
Joined: Wed Oct 29, 2008 5:46 pm

Post by helentam » Thu Jan 15, 2009 12:15 pm

I pretty much ran into the same problem. I was programming a word memory task and I was also using the "wait for ... milliseconds" command to control how long I wanted a word to be presented on the screen, and then on the next card, the learner has to type in some responses. If there are keys pressed in the previous card, these are somehow saved up and are dumped onto the next card. I've tried using flushEvent and even clearing all the pendingMessages, but neither worked.

The "wait for ... with messages" command though worked a treat. All i did was add the two magic words "with messages" at the end of the command and the problem was solved. Thanks a mil!

Post Reply