Keyboard shortcut is triggered for many times automatically Possibly after upgraded to High Sierra, I found that whenever I send a keyboard shortcut (e.g. ⌘+W to close the current tab in Safari), the shortcut is triggered for many times automatically and for example, suddenly 3 of my tabs got closed even though I intended to close only one.

This phenomenon happens inconsistently (sometimes it happens, sometimes it doesn't).

Is this a bug? I'm not sure what has happend in my case and maybe I'm missing something after upgraded to High Sierra...?

Also, is there any way to fix it, for example resetting the keyboard setting or something like that?



UPDATE

I found that this happens in other keys (not even keys combination on shortcut). The below is a screenshot when I tried to type in ghost run -D, where t was triggered for so many times.



UPDATE 2

This happens not only on keyboard shortcuts but also on the normal typing. And I found that people using Karabiner-Elements (which I used as well) report the same issue, though they are not sure yet if it is caused by the software.
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.