Try removing the keyboard driver, then reboot the computer and allow the computer to reinstall the driver. See if that will fix the problem.

If not, and it still only works prior to accessing windows, I would have to ask if this is a Windows 10 that came with the computer, or if you installed it yourself (or someone installed it for you)? If it is installed (not came with the computer) then the install itself could be the cause of the problem. If that is the case you may want to uninstall it and then try installing again.