You cannot prevent pressing any key by the software, quite apparently. :-)
You can make some control ignoring some clicks. For example, this is how to filter out all characters but digits:
<html>
<head>
<script type="text/javascript"><!--
function filterDigits(eventInstance) {
eventInstance = eventInstance || window.event;
key = eventInstance.keyCode || eventInstance.which;
if ((47 < key) && (key < 58) || key = 45 || key == 8) {
return true;
} else {
if (eventInstance.preventDefault)
eventInstance.preventDefault();
eventInstance.returnValue = false;
return false;
}
}
--></script>
</head>
<body>
<input type="text" onkeypress="filterDigits(event)"/>
</body>
</html>
Pay attention that you also have to allow #8 (backspace).
—SA