Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!apple!bionet!agate!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga.tech Subject: Re: Opposite of Deadkeyconvert() ? Message-ID: <8810260245.AA01372@cory.Berkeley.EDU> Date: 26 Oct 88 02:45:16 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 22 :Is there a CBM-blessed method for taking an ASCII character and determining :the rawkey scancode(s) that are necessary to generate it? Note this is :the _opposite_ of deadkeyconvert(). Ideally it should handle the entire :printable ASCII set, including those requiring a deadkey first, and :allowed combinations of qualifiers. : :John Look at KEYBOARD.C in the DME source just posted by the moderator to comp.sources.amiga ... DME does this kind of reverse engineering when it starts up so it can convert key specifications to raw codes for the MAP command. Essentially you just declare an InputEvent structure and stuff it, in turn, with all the keycodes, then send it through RawKeyConvert() to see what ascii, if any, turns up. There are some special cases, like multiple codes mapping to the same ascii char, but all in all it's relatively painless. The other way to do it, especially if you want to be fancy and figure out multiple-key sequences, it to obtain the keymap and scan that. -Matt