Feather Bluefruit 32u4 - toggle between HID keyboard and BLE Midi?

With the Feather Bluefruit 32u4, is it possible to read the state of a toggle switch (Mode 1 or Mode 2) to have the device follow different sets of commands?

For example,

In Mode 1 - act as bluetooth HID keyboard, sending keystrokes
In Mode 2 - act as BLE MIDI device,

I have code written for both scenarios. I can not determine how to make the device be recognized as one or the other.

Thank you for sharing your experiences with this.