The Commodore 64 keyboard is a nice thing, and there are a few things you can do with it. One is run it with a real Commodore 64 inside, another would be use it as a USB keyboard with a PC. I've called this shared or time shared, as this allows you to do both with the same keyboard, just not at the same time.
The board has a header on the bottom that plugs into the Commodore 64. The original keyboard and power LED then plug into this board. As there is still a full Commodore 64 inside, the USB cable can be fed through a gap in the user port.
You can see more clearly on this partly populated version, the keyboard is not connected directly through to the Commodore 64, but via a set of switch ICs.
These switches are controlled by one of the lines on the keyboard connector which has 5V on when the Commodore 64 is on. In this state, the switches connect the keyboard through to the Commodore 64. The USB keyboard is disabled when this happens, it appears as if it has been unplugged.
When the Commodore 64 is turned off, that signal drops to 0V, so the switches are turned off and the USB keyboard controller is enabled. The Commodore 64 has priority, whenever it is switched on, it has control of the keyboard. Whenever it is off, it works as a USB keyboard. How you split your priorities between the two modes is up to your conscience.
The power LED on the Commodore 64 can be connected to the new board, so it shows if either the USB keyboard or C64 are in use. The LED cable on the C64 is not quite long enough to reach, so I supply an extension. It is a 3 pin reversible connector, so just make sure the two populated wires are together.
This is suitable for Commodore 64, but not the C64C (there isn't space under the keyboard). You can order the kit below, but you need to supply your own working Commodore 64.
This will not work with the C64C or C64 Reloaded boards due to changes to the circuitry used on the restore key. I've designed a new version which adds in additional switching to work with these boards, available soon.