kb.getKeys(....., clear= True)
tells the keyboard to remove / clear the returned events from the keyboard buffer; any keyboard events not returned by the call will stay in the event buffer.
To clear the full keyboard event buffer, use:
kb.clearEvents()