This shouldn’t be a real problem, as the keyboard charges when it’s on, so be sure to have some light shine on it part of the day and that’s good enough, indirect window light it’s perfectly fine enough.
IIRC maintaining Caps lock pressed (even with the power switch off) makes the keyboard be powered on, but without charging. I believe this is there in place for diagnostic reasons and resetting something. It could be stuck in some way so that could be a problem, just leave the power switch on and let it charge every day.
Battery getting old makes it appear as if it wouldn’t charge, in my experience (4 batteries dead in total with 2 keyboards, about 3 years each) they don’t last long, and has very little to do with usage or light exposure as I have one of them in a very well lit area and other in a mostly dark space.