It gets tricky when you want to hold down the shift keys, because then you also have to watch for keyup events as well as the keydown event.
on my keyboard, Chrome and Firefox seem to have a bug when you press both shift keys at the same time. Only one of the keyup events fires. This doesn't happen for the CTRL keys, and it doesn't happen in Edge...
you can get my sample here: https://www.rieperts.com/games/forum/LeftRightShift.capx