<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>This is my work around for keyboard shortcuts with
the Unicode VM...</FONT></DIV>
<DIV><FONT face=Arial size=2>The UnicodeInputInterpreter has this method
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>nextCharFrom: sensor firstEvt: evtBuf</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> | keyValue |<BR>" Unicode charCode expected
as the sixth data member ! "</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>"If Alt or Ctrl is pressed and we have a
unicode char code... delegate shortcut conversion to the locale specific
class..."</FONT></DIV>
<DIV><FONT face=Arial size=2> (((evtBuf fifth = 2 or: [evtBuf fifth = 8]))
and: [evtBuf sixth > 255])<BR> ifTrue:
[<BR> keyValue := evtBuf
sixth.<BR> ^ Character value:(((Locale currentPlatform)
languageEnvironment) unicodeToLatinCharMap:keyValue).]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> ifFalse: [keyValue := evtBuf
sixth.].<BR> ^ keyValue asCharacter.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>(OK, it needs some refactoring but you get the
clue...)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2> </DIV></FONT>
<DIV><FONT face=Arial size=2>Now the specific locale class (for me is the
GreekEnvironment class) must have an instance method called</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2>
unicodeToLatinCharMap:charCode</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>that will convert the unicode char codes
to MacRoman codes that work for the shortcuts.</FONT></DIV>
<DIV><FONT face=Arial size=2>I know the the all-around conversion back to
MacRoman seems redundant, but at least we avoided the pollution of the unicode
environment classes with locale specific code...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The trick was that we can get an instance of the
current LanguageEnvironment, without referring to it, with</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> (Locale currentPlatform)
languageEnvironment</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Good Smalltalk...good...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I don't know though for how long we are going to
get away with it this way...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Christos.</DIV></FONT></BODY></HTML>