Before trying the following, please note that the monitor and the keyboard have nothing to do with each other. So the keyboard not working wouldn't have anything to do with the external monitor. If you can see the system on the external monitor, then it is working.
NOTE: If you need to type in a password to even get into Windows to do the following, make sure you attached an external keyboard first, to get past the password. Then disconnect the external keyboard and try the following...
1. Uninstall the keyboard driver.
2. Reboot the computer (without reinstalling the driver).
3. When it restarts, it should reinstall the driver on its own.
If this doesn't work, you may wish to try connecting/reconnecting an external keyboard and see...