tapDelay is not performing as expected

Hi, I have a little problem with tapDelay and tap detection.

I wrote the code below. I think it should let me 6 seconds to tap six times and then print the message with the “Awesome” message.

[lua]system.setTapDelay (6);

background=display.newImage(“whitebg.png”);
local function countTaps (event)
if event.numTaps == 6 then
print (“awesome”);
elseif event.numTaps == 1 then
print (“not so cool”);
end
print(“END OF FUNCTION \n”);
end

background:addEventListener (“tap”, countTaps);[/lua]

However I am using my superskills of FPS player to click 4 times per second I only get this:

[text]
not so cool
END OF FUNCTION

END OF FUNCTION

not so cool
END OF FUNCTION

END OF FUNCTION

not so cool
END OF FUNCTION

END OF FUNCTION
[/text]

What am I doing wrong?
And how can I search topics in the forum since you change the design? :slight_smile: [import]uid: 140715 topic_id: 27653 reply_id: 327653[/import]

Extra information about what I am trying:

At beginning I tried the same but just with two taps for “Awesome”. It prints “Awesome” but I need to double tap really quick. If the double tap takes more than 1 second then I get “not so cool” however I set the delay for 6 seconds.

Also I noticed that when I achieve to get “awesome” it prints before “not so cool”, which is a problem for what I want to do:

  • If double tap -> does something and ignore the 1 tap option
  • if one tap -> does one tap stuff

But how it is working currently what happens is:

  • I do one tap stuff, oh! and also double tap stuff.

[import]uid: 140715 topic_id: 27653 reply_id: 112218[/import]

Ok. I made a walk around which is working for my purpose…

[lua]local tapnum = 0;
local taptimer = 0;
local MAXT = 30;

–system.setTapDelay (1);

background=display.newImage(“whitebg.png”);
local function countTaps (event)
tapnum = tapnum +1;
end

local function printit (event)

if tapnum >= 2 and taptimer == MAXT then
print (“DoubleTap”);
tapnum = 0;
taptimer = 0;

elseif tapnum == 1 and taptimer == MAXT then
print (“ONEtap”);
tapnum = 0;
taptimer = 0;

elseif taptimer == MAXT then
print(" NO TAP ");
tapnum = 0;
taptimer = 0;

else taptimer = taptimer +1;

end

end

background:addEventListener (“tap”, countTaps);
Runtime:addEventListener (“enterFrame”, printit);[/lua] [import]uid: 140715 topic_id: 27653 reply_id: 112871[/import]