One possible way would be to write a python script that reads a GPIO pin (or two, one for dots and one for dashes if you want an iambic paddle), plays a tone using the simpleaudio library. Then use jack to route that sound into a virtual sound card that FLdigi can use.?
?
I did something similar to this using a RP2040W to generate MIDI data that connected wirelessly over Bluetooth to a virtual instrument on my Mac, but it was mostly just to see if I could write it. I didn't go much beyond any practical application.?