home *** CD-ROM | disk | FTP | other *** search
- on keyHandler
- global fieldNM
- if (the key = RETURN) or (the key = TAB) then
- enterChar()
- else
- if the key = numToChar(8) then
- deleteChar()
- else
- if the commandDown or (charToNum(the key) < 32) or (charToNum(the key) > 216) then
- dontPassEvent()
- else
- enterChar()
- end if
- end if
- end if
- end
-
- on enterChar
- global charCnt, strg1, strg2, charPos, KeyMod, fieldNM, MaxChars, fieldIndex, Warned, logged, Stall
- set KeyMod to 1
- set Warned to 0
- if logged = 1 then
- puppetSound("EntryLogged")
- return
- end if
- set charCnt to the number of chars in field fieldNM
- if (the key = RETURN) or (the key = TAB) then
- puppetSound("TextClick")
- updateStage()
- set Stall to 0
- if strg1 = -1 then
- nothing()
- else
- put strg1 & strg2 into field fieldNM
- set strg1 to -1
- set strg2 to EMPTY
- when timeOut then nothing
- end if
- getNextField()
- if fieldNM = "Key1" then
- set the castNum of sprite 9 to the number of cast "Key 1"
- set the locH of sprite 9 to 87
- set the locV of sprite 9 to 232
- set fieldIndex to 1
- set MaxChars to 10
- else
- if fieldNM = "Key2" then
- set the castNum of sprite 9 to the number of cast "Key 2"
- set the locH of sprite 9 to 266
- set the locV of sprite 9 to 231
- set fieldIndex to 2
- set MaxChars to 10
- else
- if fieldNM = "Key3" then
- set the castNum of sprite 9 to the number of cast "Key 3"
- set the locH of sprite 9 to 444
- set the locV of sprite 9 to 230
- set fieldIndex to 3
- set MaxChars to 10
- else
- if fieldNM = "LogEntry" then
- set the castNum of sprite 9 to the number of cast "Log Entry"
- set the locH of sprite 9 to 286
- set the locV of sprite 9 to 265
- set fieldIndex to 4
- set MaxChars to 275
- else
- return
- end if
- end if
- end if
- end if
- updateStage()
- return
- else
- if the key = "," then
- set KeyChar to " "
- else
- set KeyChar to the key
- end if
- if charCnt = 0 then
- put KeyChar into field fieldNM
- set charCnt to 1
- else
- if charCnt <= MaxChars then
- if strg1 = -1 then
- put field fieldNM & KeyChar into field fieldNM
- else
- set strg1 to strg1 & KeyChar
- put strg1 & "*" & strg2 into field fieldNM
- set charPos to the number of chars in strg1 + 1
- end if
- set charCnt to charCnt + 1
- else
- if Stall = 0 then
- keySound("FieldFul")
- set Stall to 1
- end if
- end if
- end if
- dontPassEvent()
- end if
- end
-
- on deleteChar
- global charCnt, strg1, strg2, charPos, KeyMod, fieldNM, Stall
- set KeyMod to 1
- set Stall to 0
- if charCnt > 1 then
- set charCnt to charCnt - 1
- if strg1 = -1 then
- put chars(field fieldNM, 1, charCnt) into field fieldNM
- else
- set strg1 to chars(strg1, 1, the number of chars in strg1 - 1)
- put strg1 & "*" & strg2 into field fieldNM
- set charPos to the number of chars in strg1 + 1
- end if
- else
- put " " into field fieldNM
- set strg1 to -1
- set strg2 to EMPTY
- when timeOut then nothing
- end if
- end
-
- on getNextField
- global FieldNames, fieldNM, fieldIndex
- if fieldIndex < 4 then
- if the number of words in field ("key" & fieldIndex) <= 1 then
- nothing()
- else
- PlaySound(1, "navVocal:KeyWdCnt", 0, 0)
- put " " into field ("key" & fieldIndex)
- return
- end if
- end if
- if fieldIndex = 4 then
- set fieldIndex to 1
- else
- set fieldIndex to fieldIndex + 1
- end if
- set fieldNM to FieldNames(mget, fieldIndex)
- end
-
- on selectCast
- global MaxChars, strg1, strg2, charPos, fieldNM, charCnt, Warned, fieldIndex, logged, Stall
- set Warned to 0
- set Stall to 0
- set charPos to the mouseChar
- if logged = 1 then
- puppetSound("EntryLogged")
- return
- end if
- puppetSound("TextClick")
- updateStage()
- if strg1 = -1 then
- nothing()
- else
- put strg1 & strg2 into field fieldNM
- set strg1 to -1
- set strg2 to EMPTY
- when timeOut then nothing
- end if
- set fieldNM to the name of cast the mouseCast
- if fieldNM = "Key1" then
- set the castNum of sprite 9 to the number of cast "Key 1"
- set the locH of sprite 9 to 87
- set the locV of sprite 9 to 232
- set fieldIndex to 1
- set MaxChars to 10
- else
- if fieldNM = "Key2" then
- set the castNum of sprite 9 to the number of cast "Key 2"
- set the locH of sprite 9 to 266
- set the locV of sprite 9 to 231
- set fieldIndex to 2
- set MaxChars to 10
- else
- if fieldNM = "Key3" then
- set the castNum of sprite 9 to the number of cast "Key 3"
- set the locH of sprite 9 to 444
- set the locV of sprite 9 to 230
- set fieldIndex to 3
- set MaxChars to 10
- else
- if fieldNM = "LogEntry" then
- set the castNum of sprite 9 to the number of cast "Log Entry"
- set the locH of sprite 9 to 286
- set the locV of sprite 9 to 265
- set fieldIndex to 4
- set MaxChars to 275
- else
- return
- end if
- end if
- end if
- end if
- updateStage()
- set charCnt to the number of chars in field fieldNM
- set fieldString to field fieldNM
- if fieldString = " " then
- when timeOut then nothing
- set strg1 to -1
- set strg2 to EMPTY
- else
- set strg1 to chars(fieldString, 1, charPos - 1)
- set strg2 to chars(fieldString, charPos, the number of chars in fieldString)
- put strg1 & "*" & strg2 into field fieldNM
- when timeOut then ToggleInsert
- end if
- end
-
- on ToggleInsert
- when timeOut then nothing
- end
-