local sStarTime
on opencard
put the milliseconds into sStarTime
end opencard
on mouseUp
put the milliseconds into tTime
if tTime > sStarTime +500 then
beep
else
-- do your stuff
end if
put the milliseconds into sStarTime
end mouseUp

on rawkeydown pKey
put the milliseconds into tTime
if tTime > sStarTime +500 then
put the milliseconds into sStarTime
pass rawkeydown --or do your stuff
else
--
end if
put the milliseconds into sStarTime
end rawkeydown