home *** CD-ROM | disk | FTP | other *** search
/ PC Direkt 1998 #11 / PCDIREKT_1198.bin / SHOWDATA / KONFIG.DXR / 00007.ls < prev    next >
Encoding:
Text File  |  1997-07-31  |  2.2 KB  |  89 lines

  1. global gPW
  2.  
  3. on keyDown
  4.   case the key of
  5.     RETURN, ENTER:
  6.       doOKButton()
  7.     otherwise:
  8.       if the keyCode < 115 then
  9.         encrypt(the key)
  10.       else
  11.         case the keyCode of
  12.           123:
  13.             if the selEnd = the selStart then
  14.               set the selStart to the selStart - 1
  15.             end if
  16.             set the selEnd to the selStart
  17.           124:
  18.             if the selEnd = the selStart then
  19.               set the selEnd to the selEnd + 1
  20.             end if
  21.             set the selStart to the selEnd
  22.           125:
  23.             if the selEnd > the selStart then
  24.               set the selStart to the selEnd
  25.             else
  26.               set the selEnd to 1000
  27.               set the selStart to 1000
  28.             end if
  29.           126:
  30.             if the selEnd > the selStart then
  31.               set the selEnd to the selStart
  32.             else
  33.               set the selStart to 0
  34.               set the selEnd to the selStart
  35.             end if
  36.           117:
  37.             if the commandDown then
  38.               beep(3)
  39.               alert(the text of member "easteregg")
  40.             end if
  41.           otherwise:
  42.             beep()
  43.         end case
  44.       end if
  45.   end case
  46. end
  47.  
  48. on encrypt k
  49.   set l to length(gPW)
  50.   case k of
  51.     BACKSPACE:
  52.       if the selEnd > the selStart then
  53.         set gPW to EMPTY
  54.         set the text of member "PASSWORT" to EMPTY
  55.         set l to 0
  56.       else
  57.         if l > 1 then
  58.           set gPW to char 1 to l - 1 of gPW
  59.           set temp to the text of member "PASSWORT"
  60.           set the text of member "PASSWORT" to char 1 to l - 1 of temp
  61.         else
  62.           if l > 0 then
  63.             set gPW to EMPTY
  64.             set the text of member "PASSWORT" to EMPTY
  65.           end if
  66.         end if
  67.       end if
  68.     TAB:
  69.       set the selStart to 0
  70.       set the selEnd to l + 2
  71.       pass()
  72.     otherwise:
  73.       if the selEnd > the selStart then
  74.         set gPW to k
  75.         set the text of member "PASSWORT" to "x"
  76.         set l to 0
  77.       else
  78.         if gPW = EMPTY then
  79.           set gPW to k
  80.           set the text of member "PASSWORT" to "x"
  81.         else
  82.           put k after gPW
  83.           set the text of member "PASSWORT" to the text of member "PASSWORT" & "x"
  84.         end if
  85.       end if
  86.   end case
  87.   set the selStart to l + 2
  88. end
  89.