I thought that it would be a good idea to make use of the built-in LIRC driver of the Linux kernel. Currently, there is a --lirc option for interfacing to a user-space driver (lircd), but nothing for using the kernel driver. The "remote" plugin can interface with /dev/input/event* but not with /dev/lirc* (except when REMOTE_FEATURE_LIRCOLD is enabled, to use an older protocol).
The kernel LIRC driver exposes a raw interface to the actual received IR messages, allowing applications to implement key-repeat more accurately than the input event driver.
The attached patch uses LIRC_MODE_SCANCODE, which reports key codes, scan codes and monotonic timestamps. This initial patch is based on cLircRemote and the timing logic was not simplified yet. The reported keycodes can be configured with ir-keytable.
I have tested this patch on Raspberry Pi 2 B, on a 5.10 kernel as well as on a 6.0.6 kernel that was built following the instructions at https://www.raspberrypi.com/documentation/computers/linux_kernel.html and choosing the rpi-6.0.y branch.
Best regards,
Marko