Switching Magic Keyboard 2 between iPad and mac?

Does anyone know a way to quickly switch between their keyboard from their mac to their iPad? I always find I have to make my computer or iPad forget the keyboard to reconnect, is there an easier method or app that simplifies the process? I think I may have been spoiled by AirPods in combination with Tooth fairy. I know Logitech has some keyboards that allow you to connect up to 3 devices, but I’m trying to avoid buying another keyboard.

I have a note to check this out when I finally get back to my iMac:

It might do what you need?

Not exactly, but it does look neat! Sometimes I take my iPad and magic keyboard without my mac. I do sometimes have a mac and iPad open so this might still be very useful! Thanks for sharing.