Thanks very much. It works fine in Mac OS X 10.6.8.
Lawson
On 9/29/11 12:18 PM, Bert Freudenberg wrote:
Nice that it works for your purpose. It's wrong, however.
The keycodes in down and up events really should match. And they should refer to raw keys. E.g., you should get the same keycode for X and Shift-X (though for Shift-A you would get additional Shift-Down and Shift-Up events).
I am sure this was working at some point. So we just need to find out where along the way it got broken.
I just took a look using a 4.2 Mac VM. And lo and behold, the VM *does* work, it produces the expected key down/up codes. Which btw are Apple's "Virtual Keycodes", see e.g. http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes
However, Morphic event handling was broken when the keyboard interpreter was added. That must be used only for stroke events, not for up/down events. I just fixed that in trunk. And it works! Not bad for a two-line fix.
And trying that Morphic fix on a Cog VM works fine. So, no VM change needed. All is good. (Well, could be better, like reporting shift-up/down too, but at least most keys are working)
Have fun!
- Bert -