VM wiht Japanese input [Was: Japanese input in DrGeo]
Hello, Do you know if these VM changes are already part of recent VM? or if it can become part? Thanks Hilaire -------- Message transféré -------- Sujet : Re: Japanese input in DrGeo Date : Wed, 10 Dec 2014 21:51:22 +0900 De : TAKAHASHI Makoto <makoto@kobe-u.ac.jp> Pour : hfern@free.fr Hello Hilarie, This information that was sent previously, I will resend because you might have missed. TAKAHASHI Makoto wrote:$B!X(BRe: Japanese input in DrGeo$B!Y(B (Fri, 11 Apr 2014 22:46:30 +0900)
Hello Hilarie,
Recently, Hachisuka-San in Aichi Sangyo University has resolved the issue of Scratch in Linux. http://www.asu.ac.jp/hachi/v3/scratch14ime.html
Unfortunately, this page is written in Japanese. (However you can see codes.) The resolution of the problem in DrGeo is as follows: 1. In drgeo.sh, add exec options '-compositioninput' like exec "$VM/pharo" \ -plugins "$VM" \ -encoding utf-8 \ -vm-display-X11 \ -compositioninput \ "$image"
2. Change recordPendingKeys(void) in vm-display-X11/sqUnixX11.c as follows and rebuild vm-display-X11.
static int recordPendingKeys(void) { if (inputCount <= 0) { if (inputBuf != inputString) { free(inputBuf); inputBuf= inputString; } return 0; }
int utf32 = 0; while (inputCount > 0) { //110x xxxx 10xx xxxx if(inputCount >= 2 && pendingKey[0] >= 0xc0 && pendingKey[0] <= 0xdf && pendingKey[1] >= 0x80 && pendingKey[1] <= 0xbf) { utf32 = ((pendingKey[0] & 0x1f) << 6) | (pendingKey[1] & 0x3f); recordKeyboardEvent(0, EventKeyDown, modifierState, utf32); recordKeyboardEvent(0, EventKeyChar, modifierState, utf32); pendingKey+=2; inputCount-=2; //1110 xxxx 10xx xxxx 10xx xxxx } else if(inputCount >= 3 && pendingKey[0] >= 0xe0 && pendingKey[0] <= 0xef && pendingKey[1] >= 0x80 && pendingKey[1] <= 0xbf && pendingKey[2] >= 0x80 && pendingKey[2] <= 0xbf) { utf32 = ((pendingKey[0] & 0x0f) << 12) | ((pendingKey[1] & 0x3f) << 6) | (pendingKey[2] & 0x3f); recordKeyboardEvent(0, EventKeyDown, modifierState, utf32); recordKeyboardEvent(0, EventKeyChar, modifierState, utf32); pendingKey+=3; inputCount-=3; //1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx } else if(inputCount >= 4 && pendingKey[0] >= 0xf0 && pendingKey[0] <= 0xf7 && pendingKey[1] >= 0x80 && pendingKey[1] <= 0xbf && pendingKey[2] >= 0x80 && pendingKey[2] <= 0xbf && pendingKey[3] >= 0x80 && pendingKey[3] <= 0xbf) { utf32 = ((pendingKey[0] & 0x07) << 18) | ((pendingKey[1] & 0x3f) << 12) | ((pendingKey[2] & 0x3f) << 6) | (pendingKey[3] & 0x3f); recordKeyboardEvent(0, EventKeyDown, modifierState, utf32); recordKeyboardEvent(0, EventKeyChar, modifierState, utf32); pendingKey+=4; inputCount-=4; } else { recordKeyboardEvent(*pendingKey, EventKeyDown, modifierState, 0); recordKeyboardEvent(*pendingKey, EventKeyChar, modifierState, 0); recordKeystroke(*pendingKey); /* DEPRECATED */ pendingKey++; inputCount--; } } return 1; }
3. Exchange vm-display-X11 in DrGeo.app/Contents/Linux.
I tried this resolution. Finally I can put japanese character in DrGeo in LinuxMint 16.
participants (1)
-
Hilaire