Try pressing F* on your keyboard during startup. If it work's select Safe Mode with Networking. If it let's you login, update your antivirus and run a full scan and let it remove any found threats. Now go to
www.malwarebytes.org and download Malwarebytes Anti Malware free. Instill it, open it up and let it update it's definitions, Click on Full Scan and let it remove anything it finds. If the keyboard work's in Safe Mode with networking, type Device in the start menu's search box and click on Device Manager up at the top. Is there a exclamation mark next to keyboard ? If yes, right-click on your keyboard in the list and click on Update Driver and click on Update Driver Software ... . If that work's restart your pc. If it doesn't...