replace USB A plug with micro-B
Your phone is an "OTG device", meaning that it can assume both roles - the role of USB host, and the role of USB device. You want it to be a USB host to drive your keyvoard.

Now notice that the u-USB plug has FIVE pins. These pins include the pin named ID:



If you need your tablet to act as host, the ID pin must be grounded.
In all regular cables the ID pin is floating. The ID connection is buried under the plastic overmold, and it is usually a challenge to change it.