Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!microsoft!t-jlee From: t-jlee@microsoft.UUCP (Johnny Lee) Newsgroups: comp.sys.mac.programmer Subject: Re: Option Key and the Keyboard Driver, Red Ryder Summary: Amanda Walker's methods are correct Keywords: Option key, dead key, Control Key Message-ID: <9228@microsoft.UUCP> Date: 1 Dec 89 20:43:43 GMT References: <1578@intercon.com> Reply-To: t-jlee@microsoft.UUCP (Johnny Lee) Organization: Microsoft Corp., Redmond WA Lines: 36 In article ml10+@andrew.cmu.edu (Michael A. Libes) writes: [Stuff Deleted about using custom KCHR resource or patching KeyTrans] > >These are probably a bit too much effort for your need. When you get a >keyDown or autoKey event, the message field of the event contains two >integers. The loword of the message is the extended ascii value of the >key and this is modified by option. The hiword, however is the keycode >of the pressed key and the modifiers field contains all the modifiers >which were pressed at the time of the event. The keycodes for all the >keyboards are in IM I & V. You might have to do some parsing, e.g. >checking if the shift key was pressed, but this method is quite simple. > > -luni The original posting concerned using the option key as the Control key on pre-ADB keyboards. With some option-key combinations, i.e. option-e or option-n, the system will not report the keyDown since this combination is a "dead-key". The next keydown generated by the user will determine what ASCII code is returned, i.e. in the case of option-e - if you press an e afterwards you'll get an e with an accent aigu(how do you spell it??) The method you describe above will work for the other modifier keys but not the option key. I tried the same thing for Mac Nethack and it doesn't work. My kluge was to force the user to type in option-shift-N instead. Really awful, but at the time I just wanted it to work. So no, Amanda's method's aren't too much effort if you want the option key to behave like the other modifier keys. It's just the right amount. Though I wish there were another way of doing it. Something simple like setting a flag of some sort. Johnny Lee t-jlee@microsoft.UUCP Standard Disclaimer