@foone If it's a USB keyboard, why not send a complete 8-byte HID packet? That even gets you n-key rollover, and takes care of modifiers (shift, etc) at the same time. You can even extend that with chunks of 8, representing subsequent reports, finally ending with an implicit "all keys up".
e.g. /0000060000000000:0000070000000000