Requires the application xdtool (can be installed on Ubuntu with ‘sudo apt install xdotool’).
You can find the window class here.
There is a comprehensive list of keys that can be found here or here.
xdotool search --onlyvisible --class $WINDOW_CLASS key --clearmodifiers $KEY