well all you can do is push the button down and release it again and to release it you have to push it down first
so you either fire the action upon key pushed down, then there is no way to delay it (well ofc you could just delay it by any time)
or you fire it upon key release where you could take the duration into account.
the thing is, how would you determine someone wants to fire the action immediately when they hold down the key still? you would have to assume they want to charge it
you also could use some sort of modifier like if ctrl is pressed, fire the action as soon as button down is triggered, but if ctrl is not pressed, trigger the action upon key release first
i still dont understand “shortest possible time to be considered a key tap”, whenever a key release follows a key down i would consider this a key tap no matter how fast it happens