Using USB Keyboard

Just keep in mind that you can't randomly delete rows in the lookup table if a later row is needed. The comments in each row have a number that indicates the array index - these must be kept sequential. If you are only interested in the digits, you can delete the rows that follow. But if you are interested in other characters, then everything up to that character must be included in the table. For example, if your numeric keypad has a slash key (as most do) and you want to be able to receive that key, then you won't be able to delete any rows from the table as slash is the last entry.

If you are looking to translate only a small set of keys, and they cover a wide range of input values, then you could perhaps use a dictionary for the mapping rather than array.

Also, if your keypad has a numlock key, and you want it to work as intended, you will likely have to look for the numlock events and track the numlock state. Then, when a keycode comes in, you will have to modify the code you send to the sketch depending on whether numlock is currently active or not.

My scanner requirements were quite lean (limited number of characters, all upper case, no modifier keys) and the code is correspondingly lean. Even though you have a small number of keys, it's possible that the code will have to get more complex, not smaller. It all depends on how faithfully you want to handle the keypad.