Path: utzoo!mnetor!uunet!husc6!bloom-beacon!oberon!cit-vax!ucla-cs!zen!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: DEADKEYS Message-ID: <8712272146.AA27035@cory.Berkeley.EDU> Date: 27 Dec 87 21:46:25 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 57 /* * DEADKEYCONVERT() * * Using RawKeyConvert() and DeadKeyConvert() */ #include #include #include struct Device *ConsoleDevice; typedef struct IOStdReq CIO; /* * The global ConsoleDevice must be initialized before * RawKeyConvert() and DeadKeyConvert() can be used. */ init() { CIO cio; OpenDevice("console.device", -1, &cio, 0); ConsoleDevice = cio.io_Device; } /* * NOTE: For some reason DeadKeyConvert()/RawKeyConvert() seem to get * confused about the REPEAT flag, therefore the flag bit should be * cleared from the qualifier set before calling this function. * * msg -intuition RAWKEY message * buf -buffer to store result * bufsize -size of buffer * keymap -keymap to use or NULL for default * * returns: -2 illegal message * -1 buffer not large enough * 0..N # bytes placed in buffer */ DeadKeyConvert(msg,buf,bufsize,keymap) struct IntuiMessage *msg; UBYTE *buf; int bufsize; struct KeyMap *keymap; { static struct InputEvent ievent = { NULL, IECLASS_RAWKEY }; if (msg->Class != RAWKEY) return(-2); ievent.ie_Code = msg->Code; ievent.ie_Qualifier = msg->Qualifier; ievent.ie_position.ie_addr = *((APTR *)msg->IAddress); return(RawKeyConvert(&ievent,buf,bufsize,keymap)); }