Greetings everybody...
Got around with the shortcuts issue and i am
posting the solution...
Like i said earlier we'll have to map the Unicode
values to the Squeak specific shortcuts.
A simple mapping dictionary did the work...it was
less than half an afternoon work...a few buffer prints, some copy paste to a
spreadsheet and it's there...So, the UnicodeIputInterpreter has this
method...
nextCharFrom: sensor firstEvt: evtBuf
| keyValue |
" Unicode charCode expected as the sixth data member ! " (((evtBuf fifth = 2 or: [evtBuf fifth = 8])) and: [evtBuf sixth > 255]) ifTrue: [ keyValue := evtBuf sixth. ^ Character value:(((Locale currentPlatform) languageEnvironment) unicodeToLatinCharMap:keyValue).] ifFalse: [keyValue := evtBuf
sixth.].
" Transcript show: evtBuf asString; cr." keyValue > 255 ifTrue: [Transcript show: keyValue asString; cr.]. ^ keyValue asCharacter. In my locale specific GreekEnvironment class i have
this method ...
unicodeToLatinCharMap: charCode
| t5 | t5:= ShortcutMap at: charCode.
^ t5. Where ShortcutMap is initialised in the class
initialisation as following...
initialize
" GreekEnvironment initialize " ShortcutMap _ Dictionary new. ShortcutMap at: 59 put: 113. ShortcutMap at: 962 put: 119. ShortcutMap at: 949 put: 101. ShortcutMap at: 961 put: 114. ShortcutMap at: 964 put: 116. ShortcutMap at: 965 put: 121. ShortcutMap at: 952 put: 117. ShortcutMap at: 953 put: 105. ShortcutMap at: 959 put: 111. ShortcutMap at: 960 put: 112. ShortcutMap at: 945 put: 97. ShortcutMap at: 963 put: 115. ShortcutMap at: 948 put: 100. ShortcutMap at: 966 put: 102. ShortcutMap at: 947 put: 103. ShortcutMap at: 951 put: 104. ShortcutMap at: 958 put: 106. ShortcutMap at: 954 put: 107. ShortcutMap at: 955 put: 108. ShortcutMap at: 950 put: 122. ShortcutMap at: 967 put: 120. ShortcutMap at: 968 put: 99. ShortcutMap at: 969 put: 118. ShortcutMap at: 946 put: 98. ShortcutMap at: 957 put: 110. ShortcutMap at: 956 put: 109. ShortcutMap at: 917 put: 101. ShortcutMap at: 929 put: 114. ShortcutMap at: 932 put: 116. ShortcutMap at: 933 put: 121. ShortcutMap at: 920 put: 117. ShortcutMap at: 921 put: 105. ShortcutMap at: 927 put: 111. ShortcutMap at: 928 put: 112. ShortcutMap at: 913 put: 97. ShortcutMap at: 931 put: 115. ShortcutMap at: 916 put: 100. ShortcutMap at: 934 put: 102. ShortcutMap at: 915 put: 103. ShortcutMap at: 919 put: 104. ShortcutMap at: 926 put: 106. ShortcutMap at: 922 put: 107. ShortcutMap at: 923 put: 108. ShortcutMap at: 918 put: 122. ShortcutMap at: 935 put: 120. ShortcutMap at: 936 put: 99. ShortcutMap at: 937 put: 118. ShortcutMap at: 914 put: 98. ShortcutMap at: 925 put: 110. ShortcutMap at: 924 put: 109. This maps every greek keyboard key (small and
capital) to the equivelant that Squeak is expecting as shortcut...
In programming terms i don't like this
solution...so if anyone has a better idea please post it...
Evening everybody!
Christos.
|
Free forum by Nabble | Edit this page |