home *** CD-ROM | disk | FTP | other *** search
- global gPW
-
- on keyDown
- case the key of
- RETURN, ENTER:
- doOKButton()
- otherwise:
- if the keyCode < 115 then
- encrypt(the key)
- else
- case the keyCode of
- 123:
- if the selEnd = the selStart then
- set the selStart to the selStart - 1
- end if
- set the selEnd to the selStart
- 124:
- if the selEnd = the selStart then
- set the selEnd to the selEnd + 1
- end if
- set the selStart to the selEnd
- 125:
- if the selEnd > the selStart then
- set the selStart to the selEnd
- else
- set the selEnd to 1000
- set the selStart to 1000
- end if
- 126:
- if the selEnd > the selStart then
- set the selEnd to the selStart
- else
- set the selStart to 0
- set the selEnd to the selStart
- end if
- 117:
- if the commandDown then
- beep(3)
- alert(the text of member "easteregg")
- end if
- otherwise:
- beep()
- end case
- end if
- end case
- end
-
- on encrypt k
- set l to length(gPW)
- case k of
- BACKSPACE:
- if the selEnd > the selStart then
- set gPW to EMPTY
- set the text of member "PASSWORT" to EMPTY
- set l to 0
- else
- if l > 1 then
- set gPW to char 1 to l - 1 of gPW
- set temp to the text of member "PASSWORT"
- set the text of member "PASSWORT" to char 1 to l - 1 of temp
- else
- if l > 0 then
- set gPW to EMPTY
- set the text of member "PASSWORT" to EMPTY
- end if
- end if
- end if
- TAB:
- set the selStart to 0
- set the selEnd to l + 2
- pass()
- otherwise:
- if the selEnd > the selStart then
- set gPW to k
- set the text of member "PASSWORT" to "x"
- set l to 0
- else
- if gPW = EMPTY then
- set gPW to k
- set the text of member "PASSWORT" to "x"
- else
- put k after gPW
- set the text of member "PASSWORT" to the text of member "PASSWORT" & "x"
- end if
- end if
- end case
- set the selStart to l + 2
- end
-