My wireless keyboard started lagging out of a sudden. Here is what you can do to fix it. At first try changing the batteries and if it didn't work you can unplug the USB dongle and plug it back in or you can turn off your keyboard and turn it back on.
That actually was the solution for me but if it doesn't for you you can literally type keyboard problem in windows and run the troubleshooter. Or you can type device manager in Windows search bar, go to keyboards and uncheck allow the device. If what I've told you until now didn't solve your issue, you can try connecting the USB dongle into another port.
If you are using an adapter, maybe it's faulty, try connecting your dongle directly into your computer. Try connecting it directly into another computer. If it still lags, even on other computers, then your keyboard might be faulty.