This'll grab the ESC key and query you. Should be a good launching place.

-- QuittingRoutines v1.0
-- 040225 roymeo(AT)brokenoffcarantenna.com
-- Director 8.5+

-- USAGE/DESCRIPTION:
--   template for movie scripts
-- REQUIRES:
--   nothing
-- CAST CONVENTIONS:
--   none
-- SCORE CONVENTIONS:
--   none
-- USEFUL MESSAGES:
--   none
-- PARAMETERS:
--   parameter: explanation
-- OWNER:  roymeo
-- HISTORY/NOTES:
--  040225-roymeo  v1.0  created

-- PROPERTIES
global gSoundObj, gSystemObj

-- HANDLERS
on KeyDown
put "DN" &&"-"&& "the key = "&the key, charToNum(the key), "the keyCode ="& the keyCode
KeyHandler(the Key, the KeyCode)
pass --probably doesn't work
end


on KeyUp
put "UP" &&"-"&& "the key = "&the key, charToNum(the key), "the keyCode ="& the keyCode
KeyHandler(the Key, the KeyCode)
pass --probably doesn't work
end


on KeyHandler thisKey, thisKeyCode
-- trap the Escape key and variatons of it
if (thisKeyCode = 53) OR ((the commandDown)AND((thisKey = ".") OR (thisKey = "q")))then
-->EXIT
ReallyExitQuery()
else
case (thisKeyCode) of
118:
-- f4 Print
printScreen(TRUE)
100:
-- f8 bring up navigation
SendAllSprites(#ShowMIAW, "NavCheats")
8:
if (the runMode = "Author") then
SendAllSprites(#ShowMIAW, "NavCheats")
end if
end case
end if
end


on ReallyExitQuery
lAlertInfo = [ #buttons : #YesNo, #message : "Are you sure you want to quit?", #icon : #question, #title : "Quit", #movable : True]
xoMUI = new (xtra "MUI")
if objectP ( xoMUI ) then
set result = Alert(xoMUI, lAlertInfo)
case result of
1: ReallyExitYes()
2: ReallyExitNo()
end case
end if
xoMUI = 0
end


on ReallyExitYes
  halt
end

on ReallyExitNo
  stopEvent
end





-----------
Roy Crisman
Macromedia Director Programmer, Lingo Guru, Multimedia Producer
Greater Rochester Macromedia User Group (GRMMUG.org) Coordinator
277 N. Goodman St.
Rochester, NY 14607-1162
(585)473-3492 home
roymeo(AT)brokenoffcarantenna.com

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to