home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!uunet.ca!canrem!dosgate![jonathan.forbes@canrem.com]
- From: "jonathan forbes" <jonathan.forbes@canrem.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: keyboard repeat
- Message-ID: <19927.848.16364@dosgate>
- Date: 7 Sep 92 02:06:20 EST
- Reply-To: "jonathan forbes" <jonathan.forbes@canrem.com>
- Distribution: comp
- Organization: Canada Remote Systems
- Lines: 52
-
- I'm having a problem with processing VANILLAKEY/RAWKEY messages from a
- window (non-Gadtools, so I'm using GetMsg() and ReplyMsg()).
-
- My input cycle is basically:
-
- loop...
- Mask = Wait(InputSignal);
-
- ProcessMessage(...)
-
- Where the ProcessMessage() function basically does a GetMsg(), grabs the
- VANILLAKEY code, and then ReplyMsg()'s it. [The problem still exists if
- the only IDCMP flag I have is VANILLAKEY, so it's not really RAWKEY
- related].
-
- The problem is that if I hold down a key to have it repeat, my function
- will basically "hang" until another key is pressed, at which point all
- the previous keys are unqueued and displayed by my program.
-
- The problem *goes away* if I do the following (for debug purposes only,
- since it's CPU intensive):
-
- for (;;)
- {
- x = GetMsg(...)
-
- if (x) ProcessMessage(...)
- }
-
- It would seem that the problem is related to task signals somehow, but I
- can't see what the problem is. I'm not doing any SetSignal()'ing or
- anything like that, so there is no reason for it hang.
-
- Note that in all cases, my code processes as many messages as are
- waiting; i.e. I always do:
-
- while (x = GetMsg(...))
- ProcessMessage(x)
-
- Perhaps this is related?
-
- This must be a very common problem, since it's just basic i/o.
-
- I doubt it's the WA_RptQueue; I've tried not using it when opening a
- window, and setting it to 32, but neither has a very significant effect;
- the essential problem is still there; I sometimes get a "hang" until
- another key is pressed.
-
- Help!
- --
- Canada Remote Systems - Toronto, Ontario/Detroit, MI
- World's Largest PCBOARD System - 416-629-7000/629-7044
-