My keyboard just recently has no been working. It is blue tooth and I have trouble shooted it, disconnected and reconnected it but nothing is working. It will work if my the tablet is plugged in but it only works on and off. It doesn't seem like it has been picking up a charge by the light is not indicate when it is attached to the tablet itself.
While you respond to that, here's what I recommend you do:
Charge the device with an alternate adapter to check if the issue is with the adapter, as it may not be supplying enough power to charge the battery, instead it's only supplying enough to make it work when connected.
If the alternate adapter works, replace the adapter, if not, Please Contact HP to replace the keyboard as it could be a hardware malfunction: