Overriding a user's control of his or her computer will always be an interruption, and often be perceived as an invasion, of that user's workflow. The web site "isn't supposed to" have control of our computers, so exerting such control will be at least a little alarming.
That said, you broach a really important topic, being the importance of letting a user know their entry is invalid before they fill out an entire set of fields and submit them.
The approach I've found to be the least-intrusive but provide the quickest turn-around response is the flow below.
Essentially, wait for them to fill out their first field, then as they click/tab around a new field (or a field that has been invalidated), check the field that was just completed. If the field that was just completed is valid, print an unobtrusive "good" icon next to it (green, checkmark, happy face, you get the idea). If it fails the validation rules, discretely print a "bad" icon (red, "X", etc.) and a short line about what failed.
But remember, do not interrupt their workflow:
When they're finished with the field they moved to, they'll either go back to the invalid field or move on and go back later. Either way, they'll see that they have an edit to make but can do it on their own time.
In the end, they'll have a completely valid form before ever submitting, which means
- They'll only have to submit once
- They don't spend time getting mad or frustrated when their submission "fails"
- They'll like your site more
- Everyone will have cake