[Vm-dev] SqueakVM help for OLPC

Chris Petsos chrispetsos at sch.gr
Tue May 22 06:24:48 UTC 2007


Hi Subbu...

Follow these to make your VM (in Windows) unicode capable...

--- sqWin32Window.c 2007/05/18 06:04:50 1.1
+++ sqWin32Window.c 2007/05/18 10:26:22
@@ -799,6 +799,9 @@
    CreatePrefsMenu();
    SetWindowTitle();
    SetForegroundWindow(stWindow);
+/* Force Unicode WM_CHAR */
+SetWindowLongW(stWindow,GWL_WNDPROC,GetWindowLong(stWindow,GWL_WNDPROC));
+SetWindowLongW(consoleWindow,GWL_WNDPROC,GetWindowLong(consoleWindow,GWL_WN
DPROC));
  #ifndef NO_DROP
    /* drag and drop needs to be set up on per-window basis */
    SetupDragAndDrop();
@@ -1069,7 +1072,7 @@
    ctrl = GetKeyState(VK_CONTROL) & 0x8000;
    /* now the key code */
    virtCode = mapVirtualKey(msg->wParam);
-  keyCode = keymap[msg->wParam];
+  keyCode = msg->wParam;
    /* press code must differentiate */
    switch(msg->message) {
      case WM_KEYDOWN:
@@ -1110,14 +1113,14 @@
    evt = (sqKeyboardEvent*) sqNextEventPut();
    evt->type = EventTypeKeyboard;
    evt->timeStamp = msg->time;
-  evt->charCode = keyCode;
+  evt->charCode = keymap[keyCode & 0xff];
    evt->pressCode = pressCode;
    evt->modifiers = 0;
    evt->modifiers |= alt ? CommandKeyBit : 0;
    evt->modifiers |= shift ? ShiftKeyBit : 0;
    evt->modifiers |= ctrl ? CtrlKeyBit : 0;
    evt->windowIndex = msg->hwnd == stWindow ? 0 : (int) msg->hwnd;
-  evt->utf32Code = 0;
+  evt->utf32Code = keyCode;
    /* clean up reserved */
    evt->reserved1 = 0;
    /* note: several keys are not reported as character events;

Create an input interpreter with this method...

----------------------------------------------------------------------------
----------------
nextCharFrom: sensor firstEvt: evtBuf

 | keyValue |
" Unicode charCode expected as the sixth data member ! "
 keyValue := evtBuf sixth.
 Transcript show: evtBuf asString; cr.
 ^ keyValue asCharacter.
----------------------------------------------------------------------------
----------------

Download this

>>  http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-June/
>> 105184.html
>

And file-in the TrueType related stuff.
Load your favourite unicode TrueType Font...and you are there...well
almost..we will have to fix some things from this point on...

(This goes to everyone...)
What do you say we start maintaining a Unicode version of the Squeak VM for
Windows and Unix...
It is something that many countries desire as opposed by Subbu...
Also with the upcoming of OLPC with eToys inside it is something that will
be mandatory in the very near future...
It doesn't worth it for everyone trying to find glitches anf fixes for
himself...
What do you say?

Christos.

----- Original Message -----
From: "subbukk" <subbukk at gmail.com>
To: <vm-dev at lists.squeakfoundation.org>
Sent: Tuesday, May 22, 2007 8:37 AM
Subject: Re: [Vm-dev] SqueakVM help for OLPC


>
> On Wednesday 16 May 2007 12:39 am, Bert Freudenberg wrote:
> > On May 15, 2007, at 20:51 , Chris Petsos wrote:
> > > We are trying to make Squeak work with Unicode...Yoshiki Ohshima has
> > > been very helpful till now and his suggestion was to let all the data
> > > that the platform (e.g. Windows, Unix etc...) is sending,  enter the
> > > Squeak VM as is and deal with them there (in the image side) with
> > > InputInterpreter classes.
> >
> > Yeah, I know, for some strange historical reason the Japanese folks
> > like this approach ;)
>
> This woud be a preferred approach for Indic languages too. The ability to
> switch layouts through hotkeys is crucial because of multiplicity of
> languages (over 23!). I could start a paragraph in Kannada layout, switch
to
> US layout for English and arabic numerals, use Devanagari for Hindi and
then
> revert to Kannada, all in a single sentence.
>
> Currently, lack of Indic support in Squeak is a showstopper for public
schools
> in my area.
>
> Regards .. Subbu
>



More information about the Vm-dev mailing list