[Seaside] Unicode Mac Support

John M McIntosh johnmci at smalltalkconsulting.com
Sun Oct 21 20:06:17 UTC 2007

The mac carbon vm supports unicode input for keyboard entry. The  
issue then is what does smalltalk code do with it.

I'll note in Sophie we support unicode input via the Mac carbon VM.  
We are working somewhat on the Windows VM, but we not sure that it  
fully supports unicode input.
For the unix VM someone is also working on unicode input, but we've  
not heard much about that for a few weeks now.

Technically unicode characters are passed up to the EventSensor class  
as eventType EventTypeKeyboard  and for the EventKeyChar subtype  
event there is a field that contains the utf32 value.

As for the unicode clipboard support you need to look at Sophie and  
see how we interface to the Extended Clipboard support to move  
UTF8/16/32 data from the macintosh pasteboards in
and out of Squeak using the optional extended clipboard support  
plugin.  For windows this interface uses FFI versus a plugin.

 >Sophie is open-source software licensed under a version of the new  
BSD license.

For background:

we set Preferences enableGently: #unicodeInput
to enable unicode input from the macintosh VM

that uses the
MacUnicodeInputInterpreter to interpreter the raw VM event record to  
turn it into a Tweak keystroke event.

which uses  the utf32Code  field in the VM event record.

/* keyboard input event */
typedef struct sqKeyboardEvent
   int type;			/* EventTypeKeyboard */
   unsigned int timeStamp;	/* time stamp */
   int charCode;			/* character code in Mac Roman encoding */
   int pressCode;		/* press code; any of EventKeyXXX */
   int modifiers;		/* combination of xxxKeyBit */
   int utf32Code;		/* UTF-32 unicode value */
   int reserved1;		/* reserved for future use */
   int windowIndex;		/* host window structure */
} sqKeyboardEvent;

key down
charCode:  	a magic number mapping to a key on the keyboard,  
different between mac/windows
utf32Code:	0
pressCode:	EventKeyDown

key char
charCode	the macroman value of the key pressed
utf32Code:	the utf-32 value of the key pressed
pressCode	EventKeyChar

key up
charCode:  	a magic number mapping to a key on the keyboard,  
different between mac/windows
utf32Code:	0
pressCode :	EventKeyUp

On Oct 21, 2007, at 2:42 AM, Oleg Richards wrote:

> Hello Guys!
> Currently i am making my project in Visual Works (in Parallels),  
> because i easily can input russian unicode characters. But i have  
> future plans to publish  my application with gemstone/s. So i'm  
> trying in my free time to translate code to squeak (i don'tuse VW  
> specifics). But i come to problem:
> How to enable unicode support in squeak?
> 1. I need to input russian characters from keyboard into squeak
> 2. I need working unicode clipboard.
> 3. I'm working with Mac.
> Can anybody give me instructions on how this could be done?
> Cheers, Oleg_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com

More information about the seaside mailing list