home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / The Hacks! / Transport Independent Speech / SpokenSerialApp / MainFunctions.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-21  |  728 b   |  36 lines  |  [TEXT/CWIE]

  1. #ifndef __MAINFUNC__
  2. #include "MainFunctions.h"
  3. #endif
  4.  
  5. extern     SpeechChannel        theSpeechChan;
  6. extern    Boolean                gDone;    
  7. extern    Byte                formingByte;
  8. extern    Boolean                inputBufferHalfByte;
  9.  
  10. OSErr        ParseRefCon            (SpeechInfoPtr theSpeechInfo, CommandPtr theCommand)
  11. {
  12.     long                    type            = 0;
  13.     OSErr                    theErr            = noErr;
  14.     short                    hexdig            = 0;
  15.     Boolean                    done            = false,
  16.                             found            = false;
  17.     
  18. #pragma unused (theSpeechInfo)
  19.  
  20.     hexdig = theCommand->ID;
  21.  
  22.     if (inputBufferHalfByte) {
  23.         formingByte |= (Byte)hexdig;
  24.         inputBufferHalfByte = false;
  25.         // now post it to the frontmost application
  26.         PostEvent(keyDown, formingByte);
  27.         
  28.         
  29.     } else {
  30.         formingByte = (Byte)hexdig << 4;
  31.         inputBufferHalfByte = true;
  32.     }
  33.  
  34.     return theErr;
  35. }
  36.