Set modifiers in a non-reactive manner
This should prevent modifier keys from getting 'stuck'. I don't know exactly how modifiers come to be stuck. But I've experienced it on multiple occasions. I've also seen reports of shift becoming stuck--mistaken for caps lock--becoming difficult to deduce.
Edited by James R.