In summary, while the lack of a battery is probably not the main issue, power inconsistencies could still affect USB peripherals. Start by checking the power situation, then try different USB ports, update drivers, and test with another keyboard if possible.
There might be other avenues to check but I'm sure that by looking into the above we could probably get to a solid fix for your situation.
Let me know how it goes!
Cheers,
Mote