#FEATURE by cg
class: DeviceWorkstation
changed: #translateKey:forView:
handle incoming Uxxx keysyms.
--- a/DeviceWorkstation.st Fri Feb 10 21:33:14 2017 +0100
+++ b/DeviceWorkstation.st Fri Feb 10 22:30:38 2017 +0100
@@ -7097,23 +7097,35 @@
Then the result is used as a key into the translation keyboardMap
to get the final return value."
- |xlatedKey|
-
- xlatedKey := self prependModifierToKey:untranslatedKey.
-
- "/ translate via keyboardMap
-
- xlatedKey := aView keyboardMap valueFor:xlatedKey.
- xlatedKey notNil ifTrue:[
- xlatedKey isCharacter ifFalse:[
- xlatedKey isWideString ifFalse:[
- xlatedKey := xlatedKey asSymbol
- ]
- ]
- ].
+ |xlatedKey code|
+
+ xlatedKey := untranslatedKey.
+
+ "/ handle Uxxxx keysyms
+ (untranslatedKey isSymbol
+ and:[untranslatedKey size == 5
+ and:[untranslatedKey first == $U
+ and:[(code := Integer readFrom:(untranslatedKey copyFrom:2) radix:16 onError:nil) notNil
+ ]]]) ifTrue:[
+ xlatedKey := Character value:code.
+ ] ifFalse:[
+ "/ translate via keyboardMap
+
+ xlatedKey := self prependModifierToKey:xlatedKey.
+ xlatedKey := aView keyboardMap valueFor:xlatedKey.
+ xlatedKey notNil ifTrue:[
+ xlatedKey isCharacter ifFalse:[
+ xlatedKey isWideString ifFalse:[
+ xlatedKey := xlatedKey asSymbol.
+ ]
+ ]
+ ].
+ ].
+
+
^ xlatedKey
- "Modified: / 12-07-2012 / 18:37:47 / cg"
+ "Modified: / 10-02-2017 / 22:30:12 / cg"
! !
!DeviceWorkstation methodsFor:'keyboard queries'!