it was working well. then stop working in windows.What is your keyboard?
My guess it is a driver issue with Windows 8.1 that isn't impacted when in the BIOS since it doesn't use a driver.
l tried a different USB slots not work too.Have you tried a different USB slot on your motherboard?
I have seen where if you switch the USB slot it causes the driver to re-install and get the keyboard working again. In looking at most of the Cooler Master combo's on their website, I'm not seeing anything that would they won't work in 8.1, so it is a USB driver issue and switching slots on your motherboard can fix this issue. I have to do that from time to time on my work wireless mouse for some reason.
Do you have another keyboard to try or can you try that keyboard on another PC to rule out any issues there?