There's even a simpler solution. Take an FTDI cable (or some other kind of USB2Serial adapter) and connect it to the RX/TX pins (0 and 1) of the Leonardo. Then program it so that it receives the keystroke on Serial1 and sends it to the USB as a keyboard device. This way you don't need a second Arduino, the FTDI cable take much less space.