Is there a way to detect how long a key press is being held?

Among these macros is one that does one thing for a short press and another for a long press. Is that what you want or do you actually need to log the length of the press?