Simulating password entry

Yves COPPE yvescoppe at skynet.be
Wed Aug 18 16:28:29 EDT 2004


Le 18-août-04, à 21:25, Devin Asay a écrit :

> All,
>
> I'm writing an app that simulates a network server login on Mac OS X. 
> I want the password field to behave just like normal password fields 
> in OS X; i.e., bullet characters appear in place of clear text. I've 
> sorta kinda got it working by trapping the keydown message in the 
> password field, but it's quirky. Before I spend a lot of time on this, 
> I thought I'd ask: Has anyone done this and would mind sharing a 
> script?
>
> Thanks.
>
>


create a field and put this script in the field :

local thisPassword
on returninfield
   get thisPassword
   if it is "<YourPassWrod>" then
     go to stack "<your mainStack>l"
   else
     answer "Tentative illégale !"
   end if
end returninfield

on enterinfield
   returninfield
end enterinfield

on keydown whichKey
    put whichKey after thisPassword
   put "*" after field "pass"
end keyDown

on backspaceKey
   put empty into field "pass"
   put "" into thisPassword
end backspaceKey

on deleteKey
   put empty into field "pass"
   put "" into thisPassword
end deleteKey



hope this help.

Greetings.

Yves COPPE
yvescoppe at skynet.be


More information about the use-livecode mailing list