>I think something like this is bad because you block all keys like:
>- backspace (code 8)
>- enter (code 3)
>- return (code 13)
>- tab (code 9)
>- cursor (codes around 28 to 31)
>- page up/down
>- delete key (code maybe 127)
>and some more
I agree. The solution I've used before is to build an array filled with
boolean values indicating whether a particular key should be accepted or
not. Then you just do something like this:
if not keysTable(asc(key)) then
return true
end if
Or, depending on how you want things set up, you could reverse the
booleans and do something like this:
return keysTable(asc(key))
-Thomas
Personal web page: http://home.earthlink.net/~thomasareed/
My shareware: http://home.earthlink.net/~thomasareed/shareware/
Pixel Pen web pub. guide: http://home.earthlink.net/~thomasareed/pixelpen/
I won't rise to the occasion, but I'll slide over to it.
|