Xref: utzoo comp.sys.mac.programmer:26565 comp.sys.mac.hypercard:7083 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!olivea!apple!fernwood!uupsi!sunic!kth.se!cyklop.nada.kth.se!ulfis From: ulfis@nada.kth.se (Anders Ulfheden) Newsgroups: comp.sys.mac.programmer,comp.sys.mac.hypercard Subject: Faster keyboard processing from HyperCard Message-ID: <1991Jun27.164506.27212@nada.kth.se> Date: 27 Jun 91 16:45:06 GMT Reply-To: ulfis@nada.kth.se (Anders Ulfheden) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 49 I have developed a HyperCard stack with Communications ToolBox that contains a terminal window. (Yes, I know that HyperCards is not the best platform for this...) The heart in the window is the idle loop that looks like on idle ReadFromHost -- Get output from host computer via CTB DisplayCharacters -- Show characters in a HyperCard field -- pass idle -- Don't pass idle deeper! Faster? end idle on keyDown whatkey if whatkey is ... -- Check for specials, arrows etc -- special action taken here else SendToHost whatkey -- Pass character to host via CTB end if end keyDown Unfortunately this is a slow way to handle keyboard input from the user, especially if you make other things in the idle-loop too... Wishful thinking would be a routine that can be installed for example during openCard, and then removed during closeCard that traps keyboard input and makes a direct call to CTB for sending the character. (Ok, special action as in the keyDown routine above we maybe have to live without.) Maybe for certain keys we can pass the keycode on to HyperCard for processing there... on openCard installKeyboardRoutine end openCard on closeCard removeKeyboardRoutine end closeCard on keyDown whatkey -- We only get here if the keyboard routine doesn't handle the key end keyDown Is this possible to realize? Any suggestions or hints appreciated! Ulfis -- +------------------------------------------------------------------------------ | Anders Ulfheden | USENET: ulfis@nada.kth.se | Royal Institute of Technology