keyDown, keyUp ... nothing doing

Klaus Major klaus at major-k.de
Mon May 10 06:58:11 EDT 2004


Hi Richmond,

> I have a problem with numbers!
>
> I made a sophisticated little program that would tell me
> whether I had pressed a numeric key or not (silly really)
> and it did not work!!!!!
>
> 2 text boxes; one called "fTYPE" and the other called
> "fOUT".......
>
> focus set on "fTYPE"
>
> on keyDown
>   put empty into fld "fOUT"
>   if theKey is not a number then put "non number" into fld
> "fOUT"
>   else pass keyDown
> end keyDown
>
> and even when I hit a '2' it pops 'non number' into "fOUT"
> (USB keyboard on a G4 Mac)
> headaches in all directions...........
>
> Help gratefully received............Richmond

just add the parameter "thekey" :-)

on keyDown thekey  ##!!!
   put empty into fld "fOUT"
   if theKey is not a number then
       put "non number" into fld "fOUT"
   else
       pass keyDown
    end if
end keyDown

Hope that helps...


Regards

Klaus Major
klaus at major-k.de
www.major-k.de



More information about the use-livecode mailing list