This already exists in desktop environments. Of course, not all desktop environments have the same features. I know KDE Plasma has this. It can't work with all apps though, for the same reasons that MacOS and Windows can't have a feature like this that works with all apps. That is, unless you want to translate keystrokes into other keystrokes on a per app basis.