I just posted on the lirc list a few minutes ago. Thanks for the
suggestion.
But now that I've done it I think there may be a better solution. The
Apple remote supposedly sends a repeat code when you hold a button
down. On the first press, the remote sends the button code, but when
you hold the button down the remote then sends a repeat code instead
of the code of the button you are holding down. They did this to
conserve battery as the repeat code is shorter than the button code.
At the level I am working in LIRC that repeat code has been replaced
with the button ID of the button that is being held down. So all I see
are button codes. I think this is done by a lower layer - maybe the
usbhid driver? If I can find that, I can have the lower layer send
LIRC the repeat code and then fix LIRC to translate the repeat code
and handle repeats correctly. I would no longer need the timeout check.