First of all, thanks to all those showing interest in this project lately. Spoiler alert: I'm a bit stuck on troubleshooting at the moment and if anyone knows anything about USB, I'll be grateful for your suggestions. Here's what's happened so far:
I have modified the sliding chassis to accomodate the Q10 Keyboard and a couple of LED's (FN and Caps) on the lower part. The lower part also accomodates the encoder chip as well as anything else it needs to work (pictured). The rest of the phone (except for the battery) will be mounted on the top part and therefore I tried using the provided ribbon cable, which turned out unsuitable to transfer power and data to the chip and keyboard, so in the end I passed my own wires and hope for the best.
The position of the slider is determined by a small sensor switch on the side (pictured below next to the keyboard). The switch is N.C. and when the slider is closed, it interrupts the power line from USB.
The device also needs to be able to charge the phone without having to disconnect it every time, so I added a USB C port (but only connected Power, ground, D+ and D- ). Another NC sensor switch senses when a charger is connected and disconnects the 5.1KOhm resistor on the Configuration Channel. Without charger, the Switch closes and signals to the phone (thanks to the resistor) that the device is an OTG device. When the charger is connected, the config channel is instead connected to the charging cable which signals that there's a charger available.