Xref: utzoo comp.sys.mac.programmer:26597 comp.sys.mac.hypercard:7090 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!portal!sv!news From: leonardr@sv.portal.com (Leonard Rosenthol) Newsgroups: comp.sys.mac.programmer,comp.sys.mac.hypercard Subject: Re: Faster keyboard processing from HyperCard Message-ID: <1991Jun30.201717.8262@svc.portal.com> Date: 30 Jun 91 20:17:17 GMT References: <1991Jun27.164506.27212@nada.kth.se> Sender: usenet@svc.portal.com Reply-To: leonardr@sv.portal.com (Leonard Rosenthol) Organization: Software Ventures Corporation Lines: 26 Nntp-Posting-Host: 192.42.172.96 In article <1991Jun27.164506.27212@nada.kth.se>, ulfis@nada.kth.se (Anders Ulfheden) writes: > 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 > > [details removed to save space] > > 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... > If you are willing to go the route of XCMDs, then it is most certainly possible. With HC 2.x and XWindows, an XCMD can request that it get all the keystrokes by making a BeginXWEdit callback. Now all keystrokes will go to that X...If someone else wants to take the keyboard back, you will get an xGiveUpEdit event, which you could ignore and keep the keystrokes, though that might be sort of obnoxious. Leonard Rosenthol ---------------------------------------------------------------------- + Leonard Rosenthol | AppleLink: MACgician + + Software Ventures | GEnie: MACgician + + Internet: leonardr@sv.portal.com | AOL: MACgician + ----------------------------------------------------------------------