MODULE WMHebrewIME;
IMPORT
Strings, WMInputMethods, Texts, KernelLog;
CONST
imeName* = "Hebrew";
TYPE
IME* = OBJECT(WMInputMethods.IME)
PROCEDURE GetName*() : Strings.String;
BEGIN
RETURN Strings.NewString(imeName);
END GetName;
PROCEDURE KeyEvent*(ucs : LONGINT; flags : SET; keysym : LONGINT);
BEGIN
CASE ucs OF
| 60H : InsertChar(0000003BH)
| 71H : InsertChar(0000002FH)
| 77H : InsertChar(000005F3H)
| 65H : InsertChar(000005E7H)
| 72H : InsertChar(000005E8H)
| 74H : InsertChar(000005D0H)
| 79H : InsertChar(000005D8H)
| 75H : InsertChar(000005D5H)
| 69H : InsertChar(000005DFH)
| 6FH : InsertChar(000005DDH)
| 70H : InsertChar(000005E4H)
| 61H : InsertChar(000005E9H)
| 73H : InsertChar(000005D3H)
| 64H : InsertChar(000005D2H)
| 66H : InsertChar(000005DBH)
| 67H : InsertChar(000005E2H)
| 68H : InsertChar(000005D9H)
| 6AH : InsertChar(000005D7H)
| 6BH : InsertChar(000005DCH)
| 6CH : InsertChar(000005DAH)
| 3BH : InsertChar(000005E3H)
| 27H : InsertChar(0000002CH)
| 7AH : InsertChar(000005D6H)
| 78H : InsertChar(000005E1H)
| 63H : InsertChar(000005D1H)
| 76H : InsertChar(000005D4H)
| 62H : InsertChar(000005E0H);
| 6EH : InsertChar(000005DEH)
| 6DH : InsertChar(000005E6H)
| 2CH : InsertChar(000005EAH)
| 2EH : InsertChar(000005E5H)
| 2FH : InsertChar(0000002EH)
| 22H: InsertChar(000005F4H)
ELSE
InsertChar(ucs)
END
END KeyEvent;
END IME;
PROCEDURE Install*;
VAR ime : IME;
BEGIN
NEW(ime);
WMInputMethods.InstallIME(ime);
END Install;
PROCEDURE SelectedCharToUCS*;
VAR r : Texts.TextReader;
selectionText: Texts.Text;
ucs : LONGINT;
from, to : Texts.TextPosition;
BEGIN
IF Texts.GetLastSelection(selectionText, from, to) THEN
selectionText.AcquireRead;
NEW(r, selectionText);
r.SetPosition(Strings.Min(from.GetPosition(), to.GetPosition()));
r.ReadCh(ucs);
selectionText.ReleaseRead;
KernelLog.String("InsertChar("); KernelLog.Hex(ucs, 0); KernelLog.String("H) (**)"); KernelLog.Ln;
END;
END SelectedCharToUCS;
END WMHebrewIME.Install~
SystemTools.Free WMHebrewIME~
WMHebrewIME.SelectedCharToUCS ~
WMKeyCode.Open ~