When RPI is on, data lines of keyboard will be connected to the USB port of RPI. When RPI is off and a USB cable from PC is connected to the device, then data lines of the USB keyboard will be connected to that USB port.
The problem is that when using Raspbian Buster, the OS doesn't detect the USB keyboard at all. It isn't listed in dmesg logs nor in lsusb output. I know that maybe this is not the standard interconnection, but I can not change the hardware. And more importantly, this setup works great with Raspbian Stretch.
So, although this detection problem may be caused by the connection architecture, but there must be a software solution because as I mentioned, the USB keyboard is detected and working when the OS of RPI is Raspbian Stretch.
I think the problem lies in the RPI firmware changes that happened from Stretch to Buster, but downgrading firmware using rpi-update didn't help.
What can I do to make the Buster firmware detect this USB keyboard as Stretch does? As I mentioned, downgrading the Buster firmware/kernel from 4.19.57-v7+ to 4.9.35-v7+ (the firmware/kernel version of the working stretch release that I have) didn't help.
If it matters, the USB keyboard is an AVR based CDC device.