home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!YOSEMITE.CSUFRESNO.EDU!quang
- From: quang@YOSEMITE.CSUFRESNO.EDU (Quang Ngo)
- Newsgroups: comp.sys.mac.programmer
- Subject: Problem in C, please help!
- Message-ID: <9209112124.AA13676@yosemite.csufresno.edu>
- Date: 11 Sep 92 21:24:34 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Lines: 46
-
-
- I'm trying to write a simple keyboard driver that does the following:
-
- * It adds 1 to every character the user types, i.e., if the user types:
- 'Hello', what the user will see is: 'Ifmmp'. In general, a -> b,
- c -> d, s -> t, etc.
-
- * When the driver is running, no matter what application the user is
- using the driver still works with that application. This way, if
- , for instance, the user is using MS Word, when he types 'Hello',
- what he'll get is 'Ifmmp'.
-
- Here's a segment of the code I'm trying:
-
- HandleEvent()
- {
- if (gWNEImplemented)
- WaitNextEvent(everyEvent, &gTheEvent, SLEEP,
- NIL_MOUSE_REGION);
- else {
- SystemTask();
- GetNextEvent(everyEvent, &gTheEvent);
- }
-
- switch (gTheEvent.what) {
- case nullEvent:
- break;
- case keyDown:
- theChar = gTheEvent.message & charCodeMask;
- theChar++;
- /*printf("%c\n", theChar);*/
- break;
- case mouseDown:
- gDone = TRUE;
- break;
- }
- }
-
- Question:
- How do I store the value in theChar++ back to the gTheEvent.message?
- Did I miss something?
-
- Thanks in advance.
-
- Please email your help to
- -Quang (quang@yosemite.csufresno.edu)
-