Keyboard shortcut is triggered for many times automatically
There's two things I would try initially: testing your Mac in Safe Mode and, if that doesn't resolve things, resetting the NVRAM.

Test your Mac in Safe Mode

Follow these steps:


Fully shut down your Mac
Restart your Mac
Immediately press the Shift key and keep it down 
Let go of the Shift key when you see the login window (NOTE: If you have FileVault enabled you may need to log in twice).
Take a note of what happens (i.e. test your keyboard entry as per your question)
Exit Safe Mode by restarting your Mac as normal
Test again to see if the problem still persists


If the problem still persists after following the above steps, you can also try resetting the NVRAM.

Resetting the NVRAM

Older Macs had what's called Parameter RAM (PRAM), newer Macs use Non-Volatile Random-Access Memory (NVRAM). Since you haven't specified the exact model of Mac you have, follow these generic steps to reset the NVRAM: 


Shut down your machine. Yes, a full shut down, not just logging out.
Press the power button and then immediately press the commandoptionpr keys. 
Keep these keys pressed down for at least 20 seconds!
Let go of the keys and let your Mac reboot normally.


Note: When you log back in you may need to readjust some of your system preferences (e.g. speaker volume, screen resolution, startup disk selection, time zone information, etc).

Let me know how you go.