How to configure a Bluetooth keyboard to open and close a specific app? I want to convert my Bluetooth keyboard to some sort of control panel for my car, to open maps etc on keypress. So that I don't need to use the touchscreen while driving.

Is that possible?
Does your keyboard have media buttons by any chance? If so you can use something like Tasker or Automate (Free) to programatically set actions. I happen to have Automate on my phone and just checked you can use media buttons as a trigger e.g. pause, play, next, previous, eject etc. Then you can hook this up to start apps and voice searches easily - the interface is pretty straightforward if you haven't used one of these apps before.

If your keyboard doesn't have media buttons a generic bluetooth remote of some sort could work (try ebay/aliexpress etc.)

Quick google search says Tasker can't capture generic keypresses but that might've changed since 2015.