[squeak-dev] The Trunk: Multilingual-nice.252.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jan 6 14:36:52 UTC 2020
Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.252.mcz
==================== Summary ====================
Name: Multilingual-nice.252
Author: nice
Time: 26 December 2019, 12:00:37.667883 pm
UUID: 2a8a7c11-2a55-4a2e-8970-dc9d996e295e
Ancestors: Multilingual-nice.251
Expunge macToSqueak from Input Interpreter.
There is no more macRoman encoding of (event at: 3) - aka charCode as of https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/460
=============== Diff against Multilingual-nice.251 ===============
Item was changed:
----- Method: CP1250InputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
"Input from the Czech keyboard under Windows doesn't correspond to cp-1250 or iso-8859-2 encoding!!"
| keyValue |
keyValue := evtBuf third.
+ ^ converter toSqueak: keyValue asCharacter.
- ^ converter toSqueak: keyValue asCharacter macToSqueak.
!
Item was changed:
----- Method: MacRomanInputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
| keyValue |
keyValue := evtBuf third.
+ ^ keyValue asCharacter.
- ^ keyValue asCharacter macToSqueak.
!
Item was changed:
----- Method: SymbolInputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
| keyValue |
keyValue := evtBuf third.
+ evtBuf fifth > 1 ifTrue: [^ keyValue asCharacter].
- evtBuf fifth > 1 ifTrue: [^ keyValue asCharacter macToSqueak].
^ (self symbolKeyValueToUnicode: keyValue) asCharacter.
!
Item was changed:
----- Method: UTF32InputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
"Fall back to internal char-code if char is 0"
^(evtBuf at: 6) > 0
ifTrue: [(evtBuf at: 6) asCharacter]
ifFalse:
+ [(evtBuf at: 3) asCharacter].
- [#fixme.
- "The windows VM does not require macToSqueak for the fallback char-code
- since https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/403
- But unix VM still uses sqTextEncoding which still defaults to MacRoman...
- We should fix the Unix VM too, or create two different KeyboardInterpreter.
- Hardcoding macToSqueak is a bad idea anyway, because Unix behavior is a
- parameter that can be changed thru either --encoding VM option
- or SQUEAK_ENCODING environment variable"
- (evtBuf at: 3) asCharacter macToSqueak].
!
Item was changed:
----- Method: WinGB2312InputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
| firstCharacter secondCharacter peekEvent char1Value keyValue pressType type stream multiCharacter |
keyValue := evtBuf third.
pressType := evtBuf fourth.
pressType = EventKeyDown ifTrue: [type := #keyDown].
pressType = EventKeyUp ifTrue: [type := #keyUp].
pressType = EventKeyChar ifTrue: [type := #keystroke].
+ char1Value := (Character value: keyValue) asciiValue.
- char1Value := (Character value: keyValue) macToSqueak asciiValue.
((char1Value > 127 and: [char1Value < 160])
or: [char1Value > 223 and: [char1Value < 253]]) ifFalse: [
^ keyValue asCharacter.
].
peekEvent := sensor peekEvent.
"peekEvent printString displayAt: 0 at 0."
(peekEvent notNil and: [(peekEvent at: 4) = EventKeyDown])
ifTrue: [sensor nextEvent.
peekEvent := sensor peekEvent].
(type = #keystroke
and: [peekEvent notNil
and: [(peekEvent at: 1)
= EventTypeKeyboard
and: [(peekEvent at: 4)
= EventKeyChar]]])
ifTrue: [
firstCharacter := char1Value asCharacter.
+ secondCharacter := (peekEvent at: 3) asCharacter.
- secondCharacter := (peekEvent at: 3) asCharacter macToSqueak.
stream := ReadStream on: (String with: firstCharacter with: secondCharacter).
multiCharacter := converter nextFromStream: stream.
multiCharacter isOctetCharacter ifFalse: [
sensor nextEvent.
].
^ multiCharacter.
].
^ keyValue asCharacter.
!
Item was changed:
----- Method: WinKSX1001InputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
| firstCharacter secondCharacter peekEvent char1Value keyValue pressType type stream multiCharacter |
keyValue := evtBuf third.
pressType := evtBuf fourth.
pressType = EventKeyDown ifTrue: [type := #keyDown].
pressType = EventKeyUp ifTrue: [type := #keyUp].
pressType = EventKeyChar ifTrue: [type := #keystroke].
+ char1Value := (Character value: keyValue) asciiValue.
- char1Value := (Character value: keyValue) macToSqueak asciiValue.
((char1Value > 127 and: [char1Value < 160])
or: [char1Value > 223 and: [char1Value < 253]]) ifFalse: [
^ keyValue asCharacter.
].
peekEvent := sensor peekEvent.
"peekEvent printString displayAt: 0 at 0."
(peekEvent notNil and: [(peekEvent at: 4) = EventKeyDown])
ifTrue: [sensor nextEvent.
peekEvent := sensor peekEvent].
(type = #keystroke
and: [peekEvent notNil
and: [(peekEvent at: 1)
= EventTypeKeyboard
and: [(peekEvent at: 4)
= EventKeyChar]]])
ifTrue: [
firstCharacter := char1Value asCharacter.
+ secondCharacter := (peekEvent at: 3) asCharacter.
- secondCharacter := (peekEvent at: 3) asCharacter macToSqueak.
stream := ReadStream on: (String with: firstCharacter with: secondCharacter).
multiCharacter := converter nextFromStream: stream.
multiCharacter isOctetCharacter ifFalse: [
sensor nextEvent.
].
^ multiCharacter.
].
^ keyValue asCharacter.
!
Item was changed:
----- Method: WinShiftJISInputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----
nextCharFrom: sensor firstEvt: evtBuf
| firstCharacter secondCharacter peekEvent char1Value keyValue pressType type stream multiCharacter |
keyValue := evtBuf third.
pressType := evtBuf fourth.
pressType = EventKeyDown ifTrue: [type := #keyDown].
pressType = EventKeyUp ifTrue: [type := #keyUp].
pressType = EventKeyChar ifTrue: [type := #keystroke].
+ char1Value := (Character value: keyValue) asciiValue.
- char1Value := (Character value: keyValue) macToSqueak asciiValue.
(char1Value < 16r81) ifTrue: [^ keyValue asCharacter].
(char1Value > 16rA0 and: [char1Value < 16rE0]) ifTrue: [^ ShiftJISTextConverter basicNew katakanaValue: char1Value].
peekEvent := sensor peekEvent.
"peekEvent printString displayAt: 0 at 0."
(peekEvent notNil and: [(peekEvent at: 4) = EventKeyDown])
ifTrue: [sensor nextEvent.
peekEvent := sensor peekEvent].
(type = #keystroke
and: [peekEvent notNil
and: [(peekEvent at: 1)
= EventTypeKeyboard
and: [(peekEvent at: 4)
= EventKeyChar]]])
ifTrue: [
firstCharacter := char1Value asCharacter.
+ secondCharacter := (peekEvent at: 3) asCharacter.
- secondCharacter := (peekEvent at: 3) asCharacter macToSqueak.
stream := ReadStream on: (String with: firstCharacter with: secondCharacter).
multiCharacter := converter nextFromStream: stream.
multiCharacter isOctetCharacter ifFalse: [
sensor nextEvent.
].
^ multiCharacter.
].
^ keyValue asCharacter.
!
More information about the Squeak-dev
mailing list
|