While this project mimics the HID behaviour of a real keyboard, there is no need to doing so.
A much simpler approach is using a bitmap usage of key(s) according to the port bits.
As a positive side effect, multiple keys are detected by HID OS driver without much firmware efford.
This applies also to the 4-key and the 16-key keyboard.
Each bit in the bitmap corresponds to a key with a specific usage assigned.
So the descriptor code looks like:
Usage Page (Keyboard)
Report Size (1)
Report Count (1)
Logical Minimum (0)
Logical Maximum (1)
Input (Const) ;this bit is unused because port pin B0 is used for USB D-
Input (Const) ;this bit is unused because port pin B2 is used for USB D+
Usage (KEY5) ;when RESET DISABLE fuse is set
Input(Const) ;Bit 6 is not available on ATtiny25/45/85
Input(Const) ;Bit 7 is not available on ATtiny25/45/85
The descriptor is longer but the amount of code is much less.
Only if someone needs a boot keyboard, the behaviour must be copied from the USB HID book example.
Whereas "Usage (Keypad)" makes much more sense than "Usage (Keyboard)" for the Collection (Application), it's not recognized by Windows 98 SE. But NT based (modern) systems work well (but won't show differences in Device Manager, e.g. "HID keypad" instead of "HID keyboard").