home *** CD-ROM | disk | FTP | other *** search
/ Organic Chemistry (8th Edition) / Image.iso / pc / data1.cab / Program_Files / PC_IR_Tutor / MAINPROG / 00002.ls next >
Encoding:
Text File  |  2003-05-14  |  1.5 KB  |  79 lines

  1. on InitKeys
  2.   global leftArrow, rightArrow, retnKey, useKeys, noKeysFlag
  3.   if the machineType < 256 then
  4.     set leftArrow to 123
  5.     set rightArrow to 124
  6.     set retnKey to 36
  7.   else
  8.     set leftArrow to 37
  9.     set rightArrow to 39
  10.     set retnKey to 10
  11.   end if
  12.   when keyDown then checkKey
  13.   set noKeysFlag to 1
  14. end
  15.  
  16. on checkKey
  17.   global leftArrow, rightArrow, retnKey, useKeys, noKeysFlag
  18.   if (useKeys = 1) or (noKeysFlag = 0) then
  19.     exit
  20.     dontPassEvent()
  21.   end if
  22.   if useKeys = 2 then
  23.     if the keyCode = retnKey then
  24.       when keyDown then nothing
  25.       quit()
  26.     else
  27.       exit
  28.       dontPassEvent()
  29.     end if
  30.   end if
  31.   if (the keyCode = leftArrow) and (useKeys <> 3) then
  32.     go(marker(-1))
  33.   else
  34.     if (the keyCode = rightArrow) and (useKeys <> 4) then
  35.       go(marker(1))
  36.     end if
  37.   end if
  38.   dontPassEvent()
  39. end
  40.  
  41. on checkButton
  42.   global useKeys, framePos, noKeysFlag
  43.   set posH to the mouseH
  44.   set posV to the mouseV
  45.   if (posV > 465) or (posV < 440) or (posH > 605) or (posH < 262) then
  46.     exit
  47.   end if
  48.   if (posH > 579) and (useKeys <> 4) then
  49.     go(marker(1))
  50.   end if
  51.   if (posH > 534) and (posH < 560) and (useKeys <> 3) then
  52.     go(marker(-1))
  53.   end if
  54.   if (posH > 459) and (posH < 500) then
  55.     quit()
  56.   end if
  57.   if (posH > 384) and (posH < 425) then
  58.     set framePos to the frame
  59.     set noKeysFlag to 0
  60.     go("Help")
  61.     exit
  62.   end if
  63.   if posH < 350 then
  64.     go("Main")
  65.     exit
  66.   end if
  67. end
  68.  
  69. on goBack
  70.   global framePos, noKeysFlag
  71.   set noKeysFlag to 1
  72.   go(framePos)
  73. end
  74.  
  75. on setUseKeys theCode
  76.   global useKeys
  77.   set useKeys to theCode
  78. end
  79.