What model of keyboard is it?
What OS are you using?
Google search and download the factory driver for your OS.
Windows updates drivers and in a lot of cases it causes more problems than it fixes.
Check device manager by typing devmgmt.msc in run or search box. Expand keyboard and on the sub categories right-click & choose properties and then driver tab. Under driver tab, check and see if the rollback driver button is grayed out or not. If it's not try rolling the driver back. If it's grayed out note the dates if it's recent & if it's from MSFT. Uninstall it and install the factory driver instead.
If the factory driver works for you then you should turn off Windows updates from downloading and installing drivers & overwriting them. Type in run or search box sysdm.cpl and open that & under hardware tab press the "Device Installation Settings" button. Set it to No click apply and oK to close. After an update you should check that it's still applied. Sometimes MSFT will change settings to default after a large update.