Hi everybody,
I am developing a task in which questions are responded with arrowkeys.
But, if an key is pressed twice (or more) for the same question, the first keypress is considered as the reply for the current trial, and the other are memorized and used for the next trials, which, when they are presented, are automatically responded with the previous key presses.
How to take into account the first keypress only (and ignore the others)?
tx,
Thierry
HELP: hPB with "arrowkey"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Hi Thierry,
Here's a quick-and-dirty script which will only allow you to type a single number per second:
Hope this helped,
Jan Schenkel.
Here's a quick-and-dirty script which will only allow you to type a single number per second:
Code: Select all
local sBlockKey
on keyDown pKey
if sBlockKey then
beep
exit keyDown
end if
if pKey is an integer then
put true into sBlockKey
send "UnblockKey" to me in 2 seconds
end if
pass keyDown
end keyDown
on UnblockKey
put false into sBlockKey
end UnblockKey
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com