I'm trying to understand how to interface USB touchscreen output to a PS/2 keyboard input to map screen regions to predefined keystrokes. Specifically, 1) how to receive USB input and 2) decoding the USB touchscreen protocol. Once I can interpret the USB data to identify where the screen is touched, the rest should be straightforward. Any advice would be greatly appreciated. Thanks.
I think we need some hard detail here.
interface USB touchscreen output to a PS/2 keyboard input
Do keyboards have an input? I thought they only had outputs apart from the odd LED.
What USB touch screen do you have?
Do you want to simulate the output of a keyboard to a PC based on an input from a touch screen over USB.
There are two sorts of USB devices a host and a client. Which sort do you have?
Sorry for my ambiguity, by PS/2 keyboard input I mean the standard 6 pin mini-DIN keyboard port you'd find on an [older] PC motherboard - the "keyboard input" into a computer. The touch screen is a Shark model SHK840. It connects to standard USB-A port, like a USB mouse would. So if I'm understanding correctly, the touch screen is a USB client and the arduino would be the host.
Do you want to simulate the output of a keyboard to a PC based on an input from a touch screen over USB.
Yes.
Ok thanks for the further explanation.
While you could make a simulated keyboard output using the right Arduino and USB would enable you to directly input keys into the PC’s buffer as if it were taken from a USB keyboard. However this is only if your PC is capable of using a USB interface.
Connecting a USB as a host it a lot more tricky on an Arduino because you would first need a USB host shield or an advanced Arduino like a Due that can act as a host.
But the big big problem for both those approaches is that you need the software that will ha dale the client device. It is not just a matter of reading data, there is a whole lot of layers of protocol to go through. This is unless the device presents a standard interface to the host, like a serial interface.
If your PC can handle USB you might be better off using a program on the PC to do what you want. The Processing language is often used for that and it is free.