It could be your keyboard drivers are throwing a wobbly.
First, find your way to 'Device Manager. since you don't say what OS you are using - or indeed give any details about your computer - I cannot be specific, but generally RIGHT click on 'Computer' and then select 'Device manager' or 'Manage' then select 'Device manager'. When you open it, have a look for any yellow '!' or red 'x' against the entry for keyboard. If there are, expand the keyboard entry until you can 'see' your keyboard, double click on it and choose 'Drivers' from the gray dialogue box that will appear.
In the 'Driver' panel, at the bottom, you will see 'Uninstall drivers', click on this and accept any warnings you may get and uninstall the driver(s). Then re-boot. The drivers will re-install themselves as the computer starts up again. If this doesn't solve the problem there are other things that can be tried.
Holding any key down for 1s will produce a significant number of keystrokes ! wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww as an example.
When you post back please include the make, model and OS of your computer.