<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'>Hi All,<br><br>I got pure Morphic MouseEvents forwarded just fine (thanks to your help on the bit-fiddling) and the translation is good enough to pop up a menu from the top menu bar.<br>I had a screenshot, but it bounced the first iteration of this message, so you will have to take my word on that. (:<br><br><br>Next up is KeyboardEvents and at first glance it looks a bit daunting. Here is why.<br><br>This method in HandMorph invokes one of ~18 subclasses of KeyboardInputInterpreter <br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>HandMorph>>generateKeyboardEvent: evtBuf<br> ....<br> type = #keystroke<br> ifTrue: [keyValue := (self keyboardInterpreter nextCharFrom: Sensor firstEvt: evtBuf) asInteger]<br> ...<br></div></blockquote> <br>That nextCharFrom: firstEvt: send is where it gets interesting as it is keyboard specific.<br><br>To see why, compare the implementation in<br><br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div> MacRomanInputInterpreter >>nextCharFrom: sensor firstEvt: evtBuf<br><br> | keyValue |<br> keyValue := evtBuf third.<br> ^ keyValue asCharacter macToSqueak.<br></div></blockquote> to<br><br><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div><br>UnicodeInputInterpreter>>nextCharFrom: sensor firstEvt: evtBuf<br> "Compose Unicode character sequences"<br> | peekEvent keyValue composed |<br> "Only try this if the first event is composable and is a character event"<br> ((Unicode isComposable: (keyValue := evtBuf sixth)) <br> and:[evtBuf fourth = EventKeyChar]) ifTrue:[<br> "If we have a pending keyDown in the queue, skip that to get to the keystroke"<br> peekEvent := sensor peekEvent.<br> (peekEvent notNil and: [peekEvent fourth = EventKeyDown]) ifTrue: [<br> "skipEvent := "sensor nextEvent.<br> peekEvent := sensor peekEvent].<br> "If we have another character event in the queue, compose it"<br> (peekEvent notNil <br> and: [peekEvent first = EventTypeKeyboard <br> and:[peekEvent fourth = EventKeyChar]]) ifTrue:[<br> composed := Unicode compose: keyValue with: peekEvent sixth.<br> composed ifNotNil:[<br> sensor nextEvent.<br> ^composed]]].<br> "XXXX: Fixme. We should put the skipped event back if we haven't consumed it."<br> ^keyValue asCharacter</div></blockquote> <br><br>So, assume I have to stuff some unknown character into a primitive event to feed to the simulator....I don't think "skooch and tack on" is going to work like it did for the mouseEvents.<br><br>I will be examining this more closely in a day or two as I have to focus on some work for a client, but wanted to get it out there for your thoughts on the matter in the meantime.<br><br><br>Thanks.<br><br>tty.<br><br><br>P.S. David, when you get time, Eliot mentioned getting with you so I could contribute my work. Let me know what I need to do at your convenience.<br></div></body></html>