home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / programm / 13145 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.9 KB

  1. Path: sparky!uunet!uunet.ca!canrem!dosgate![jonathan.forbes@canrem.com]
  2. From: "jonathan forbes" <jonathan.forbes@canrem.com>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: keyboard repeat
  5. Message-ID: <19927.848.16364@dosgate>
  6. Date: 7 Sep 92 02:06:20 EST
  7. Reply-To: "jonathan forbes" <jonathan.forbes@canrem.com>
  8. Distribution: comp
  9. Organization: Canada Remote Systems
  10. Lines: 52
  11.  
  12. I'm having a problem with processing VANILLAKEY/RAWKEY messages from a
  13. window (non-Gadtools, so I'm using GetMsg() and ReplyMsg()).
  14.  
  15. My input cycle is basically:
  16.  
  17. loop...
  18.     Mask = Wait(InputSignal);
  19.  
  20.     ProcessMessage(...)
  21.  
  22. Where the ProcessMessage() function basically does a GetMsg(), grabs the
  23. VANILLAKEY code, and then ReplyMsg()'s it.  [The problem still exists if
  24. the only IDCMP flag I have is VANILLAKEY, so it's not really RAWKEY
  25. related].
  26.  
  27. The problem is that if I hold down a key to have it repeat, my function
  28. will basically "hang" until another key is pressed, at which point all
  29. the previous keys are unqueued and displayed by my program.
  30.  
  31. The problem *goes away* if I do the following (for debug purposes only,
  32. since it's CPU intensive):
  33.  
  34. for (;;)
  35.    {
  36.        x = GetMsg(...)
  37.  
  38.        if (x) ProcessMessage(...)
  39.    }
  40.  
  41. It would seem that the problem is related to task signals somehow, but I
  42. can't see what the problem is.  I'm not doing any SetSignal()'ing or
  43. anything like that, so there is no reason for it hang.
  44.  
  45. Note that in all cases, my code processes as many messages as are
  46. waiting; i.e. I always do:
  47.  
  48. while (x = GetMsg(...))
  49.    ProcessMessage(x)
  50.  
  51. Perhaps this is related?
  52.  
  53. This must be a very common problem, since it's just basic i/o.
  54.  
  55. I doubt it's the WA_RptQueue; I've tried not using it when opening a
  56. window, and setting it to 32, but neither has a very significant effect;
  57. the essential problem is still there; I sometimes get a "hang" until
  58. another key is pressed.
  59.  
  60. Help!
  61. --
  62. Canada Remote Systems  - Toronto, Ontario/Detroit, MI
  63. World's Largest PCBOARD System - 416-629-7000/629-7044
  64.