I’ve been using Touch Portal application with an Android tablet to control FS2020 and, boy what a great tool it is. Works with Apple smartphones as well.
It’s very similar to a Stream Deck - except it uses your touchscreen phone or tablet as as the keypad. Stream Deck makes a software version as well - but it’s limited to just 16 keys and costs a bit. The HW Stream Deck is very expensive.
Touch Portal is free to use, and if you pony up 12.95, it’l give you unlimited buttons and pages. I have a pages set for views and custom views, a set for Aircraft autopilot switches, lights. de-ice and all that.
Basically - any set of keystrokes can be assigned to a button. You can even set up on/off indicating buttons if the function you are automating has both an on and off keystroke sequences.
I’ve got my Android tavblet set up right next to my joystick and throttle - I’ve greatly simplified control of the sim and have reduced the need to manually enter a key command - just poke the touch screen and away we go.