Password Field - Mark Schonewille

J. Landman Gay jacque at hyperactivesw.com
Fri Dec 7 22:58:18 EST 2012


On 12/7/12 6:57 PM, Andrew Kluthe wrote:
> Hello,
>
> I have been using Mark Schonewille's password field in some of my
> stacks for a while. So far it has done the trick, but I found out
> recently that it doesn't like to play well with the number keys on the
> right of the keyboard. Are there any other password fields I could
> leverage or some basic tips for catching keystrokes from the number
> pad?
>
>

My favorite way to do this is with a trick posted by Bill Marriott some 
years ago. It acts like any other field, accepts any normal field input 
from any keyboard or input source, allows all editing functions, user 
selections, etc. and still hides what the user types. You can get the 
text just like you do from any field.

Here's what he said:

===

Here is what I thought was a very simple solution to that:

1) Include a tiny image (such as a 10x10 pixel padlock) in your stack. I
named mine "tinyPadlock."

2) Attach this script to the field used for password entry:

on keyUp
     -- enable masking of password during entry
     lock messages
     lock screen
     repeat with i = 1 to the number of characters in me
         if the imagesource of char i of me is not "tinyPadlock" then
             set the imagesource char i of me to "tinyPadlock"
         end if
     end repeat
     unlock messages
     pass keyUp
end keyUp

This handles whatever someone might do in the field, masks their input, and
still allows you to access the content of the field as if the password
masking was not used.

===

I usually use a little bullet image.

Caveat: It does fail if you leave the copy or cut menu item active. If a 
user can copy the images, the original text will be revealed when pasted 
somewhere else. Disable "copy" and "cut" when the field is in use.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list