While I don’t have an answer to why your code isn’t working, I do know that other topics about registering the duration of keypresses have come by on the forum, maybe this post could help? Logging duration of keypress to end routine - #6 by DavidBrocker