<div class="gmail_quote">2009/8/27 Andreas Raab <span dir="ltr"><<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Michal Perutka wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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>
"XXXX: Fixme. We should put the skipped event back if we haven't consumed it."<br>
<br>
^ *Unicode* value: keyValue<br>
<br>
Why evtBuf sixth ? Some keys on a Czech keyboard give me possibility to type Czech characters with diacritical marks directly. Correct codes (unicodes, e.g. 353 for $¹) I've found in evtBuf at the sixth position, not at the third. And the sixth position seems to be Ok for all characters.<br>
</blockquote>
<br>
Yes, that's correct. Mistake on my part. Element three is the old MacRoman value; number six is the UTF32 code point.<font color="#888888"></font></blockquote><div><br><br>Using evtBuf sixth throughout the method brought me problems with ctrl-c, ctrl-s, etc. and even scrolling by a mouse wheel stopped working. This modification seems to fix them:<br>
</div></div><br>UnicodeInputInterpreter>>nextCharFrom: sensor firstEvt: evtBuf <br> "Compose Unicode character sequences"<br> "Only try this if the first event is composable and is a character event"<br>
| peekEvent keyValue composed |<br> keyValue := evtBuf sixth > 127 ifTrue: [evtBuf sixth] ifFalse: [evtBuf third].<br> ((Unicode isComposable: keyValue) and: [evtBuf fourth = EventKeyChar])<br> ifTrue: [ ...<br>
<br>Cheers<br>Michal<br>