keyboard very strange behaviour
Dry joints and dodgy connections can act as diodes.  Diodes can demodulate radio signals.  That's basically how old "cats whisker" radios (crystal radios) used to work.

It sounds like the bad connection is picking up the radiated noise (EMI) from switching your light on and off and interfering with the USB data stream.

Get yourself a new keyboard, dude...