Comment on keyboard shortcuts in GMail

If you didn't already know, keyboard shortcuts can be used in GMail e.g. to compose a new mail, to archive a read mail. Those two actions (compose/archive) are the shortcuts I most use and I love it. But BUT! every so often I end up pressing a key, by mistake, that archives a mail which I didn't intend to or worse, deleting one. You might say that I can disable the action by clicking on ... undo but if I perform multiple actions, I can't undo them all. And bringing things back from the Trash is easier for me because my Trash is almost always empty but bringing things back from the Archived section is harder because it's not ordered by most recently archived.

I wish I could selectively enable/disable keyboard shortcuts. I dunno if GMail already can do this. I dunno if there's a way to add this functionality to GMail. I dunno if a different email provider has this functionality. Do you know?