Here's the procedure to connect a BT keyboard:
https://www.mobileread.com/forums/sh...d.php?t=369712 It uses ace_bt_cli which is a proprietary BT stack (not btui or btd...).
Note that it's still experimental and not trivial. It also won't work with recent keyboards with BLE (Bluetooth Low Energy) protocol.
Also, USB host mode doesn't work on Kindle, so USB keyboard won't work.