Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!news.funet.fi!cc.tut.fi!cc.tut.fi!n67786 From: n67786@cc.tut.fi (Tero Nieminen) Newsgroups: comp.sys.mac.programmer Subject: Re: character codes vs. key codes Message-ID: Date: 17 May 91 01:29:24 GMT References: <1074@sys.uea.ac.uk> Sender: n67786@cc.tut.fi (Tero Nieminen) Organization: Tampere Univ. of Technology, Finland. Lines: 23 In-Reply-To: jrk@sys.uea.ac.uk's message of 15 May 91 17:39:52 GMT In article <1074@sys.uea.ac.uk> jrk@sys.uea.ac.uk (Richard Kennaway) writes: When should one use key codes, and when character codes, to determine which key was typed? IM 1 says that one should normally use character codes, not keycodes, but sometimes one has no alternative but to use keycodes. For example, on the Extended Keyboard, the function keys F1-F15 all generate the same character code, and can only be distinguished by their keycodes. I can't experiment with all the different keyboards and Systems that exist. Are there general rules which will work in all cases? I'm not wanting to do anything low-level or complicated, like using the keyboard to control a video game, just a simple text editor that correctly handles every possible key event on all Macs, all keyboards, and all Systems. Is this possible? Not to mention the trouble of trying to compose meaningfull keyboard alternatives, like Cmd-S, Shift-Cmd-S and Option-Cmd-S. Thesse will be scattered all over the keyboard depending on the particular country. -- Tero Nieminen Tampere University of Technology n67786@cc.tut.fi Tampere, Finland, Europe