I have a project in mind. I want to get a raspberry pi to act as though it is a keyboard to another computer so that when I run a control program through a touch screen it will send keyboard commands to a USB port on another computer. This has to be done through the physical USB port on the controlled computer.

A bit of context might clarify what I want to do.

I run a mobile planetarium and that I can control through a custom remote control that the planetarium provider uses, an x box controller or a keyboard.
The custom remote control is cumbersome to use and unless you know the system inside out in the dark people do have navigation problems.
The X box controller is nice for adjusting position once you are somewhere but otherwise is quite limited
The keyboard has the same issue that you need to know the interface very well to hit the right keys.

The planetarium system runs software that I can not change and can not supplement. So I can install no drivers or clients on that computer.

What I want to do is to run a system on a raspberry pi with a touch screen. So that instead of having to remember key strokes I can just press a button on screen to say "toggle atmosphere" and it will send the appropriate signals to the USB port on the controlled computer. I'm sure this should be quite possible but I'm not sure where to start looking.

Pi Zero range can present as USB devices in gadget mode. There are drivers for HID devices like keyboards. It shouldn't be too hard to make a Zero look like a USB keyboard abd send the right button presses.

Pi Zero does not support the official Pi touch screen display.

It may be possible to connect a touch screen that runs from the GPIO, but these tend to be smallish.

Alternative is to use two Pi, connected via wifi. A Zero W to pretend to be a USB keyboard, and a 3B or 3B+ to drive the touch screen and send message to the Zero over Wifi.

Pi Zero range can present as USB devices in gadget mode. There are drivers for HID devices like keyboards. It shouldn't be too hard to make a Zero look like a USB keyboard abd send the right button presses.

Pi Zero does not support the official Pi touch screen display.

It may be possible to connect a touch screen that runs from the GPIO, but these tend to be smallish.

Alternative is to use two Pi, connected via wifi. A Zero W to pretend to be a USB keyboard, and a 3B or 3B+ to drive the touch screen and send message to the Zero over Wifi.

A better alternative may be to use a Pi3A+, as it does have the DSI connector.