Shift is set as the value of the key property when the shift key is pressed, which causes a key down event to be fired first.
The key down event stops firing periodically as long as we hold down this key because it doesn't generate a character key. When key 2 is hit, another key down event is triggered for this new key press, and because the modifier shift key is engaged, the key property value for the event is set to the string for the US keyboard type and to " for the UK keyboard type. The character key has been created, thus the before input and input events are dispatched next.
Learn more about keyboard here-
https://brainly.com/question/24921064
#SPJ4