In general, is something that is highly discouraged to do in MSFS.
In FSX or P3D, we could ask the sim to take a key and don't let anything else use it, not even the sim itself. This is no longer possible in MSFS: no Simconnect add-on can take a key and prevent the sim from using it, which will always receive the key and, if it is associated to any command, it will execute it. That's why we suggest to disable some keys of the drone camera because, by default, when you raise/lower a door in the GSX airplane editor, it will also trigger some focus change options in the camera.
Not only that, the masking doesn't work anymore even across add-ons themselves. Before, the first add-on claiming a key combination for its exclusive use would prevent the ones loaded later from getting the key. Now, all add-ons asking for the same key will happily received it, all executing what they were supposed to do with it, at the same time, which is even more confusing that having to handle key conflicts between add-ons. At least, before, you could sort them, if add-ons offered a way to change their reserved key, now you only get the confusion.
The issue is, Asobo doesn't want to have add-ons messing with the keyboard, because they fear badly programmed add-ons will do bad things, interfering with the sim which might stop responding to standard commands, if the developer didn't take enough care to use them in a sensible way.