From the information provided it's hard to know for certain whether or not the keyboard functionality issue was related to the battery. It's very uncommon for the condition of the battery to influence the functionality of the keyboard. It sounds like there may have been some other issue effecting the keyboard, such as a slightly disconnected or damaged keyboard cable (which runs near the battery). It might also be a good idea to inspect the computer for signs of liquid damage (triggered liquid contact indicators or stains could be a sign of past liquid damage). For now it would be a good idea to monitor the issue to see if the problem with the keyboard reoccurs. Good luck!