--- a/DeviceWorkstation.st Tue Jul 18 13:25:59 2000 +0200
+++ b/DeviceWorkstation.st Wed Jul 19 13:31:16 2000 +0200
@@ -5855,26 +5855,7 @@
"Modified: 28.2.1996 / 17:11:34 / cg"
!
-translateKey:untranslatedKey forView:aView
- "Return the key translated via the translation table.
- Your application program should never depend on the values returned
- by this method, but instead use symbolic keys (such as #FindNext).
- Doing so allows easier reconfiguration by changing the translation map
- in the 'smalltalk.rc' or 'display.rc' startup files.
-
- First, the modifier is prepended, making character X into
- AltX, CtrlX or CmdX (on many systems, no separate Cmd (or Meta)
- key exists; on those we always get AltX if the metaModifiers are not set correctly).
- If multiple modifiers are active, the symbol becoms the concatenation
- as in AltCtrlq (for control-alt-q). Shift will affect the last component,
- thus the above with shift becoms: AltCtrlQ instead.
- Some keyboards offer both Alt and Meta keys - on those, the first has a
- prefix of Alt, the second has Cmd as prefix. Keyboards with only an Alt
- key will will create prefix codes of Cmd for that.
- For symbolic keys (i.e.Tab, Backspace etc, shift is ignored).
- Then the result is used as a key into the translation keyboardMap
- to get the final return value."
-
+prependModifierToKey:untranslatedKey
|xlatedKey s modifier|
xlatedKey := untranslatedKey.
@@ -5899,6 +5880,35 @@
].
].
+ ^ xlatedKey
+!
+
+translateKey:untranslatedKey forView:aView
+ "Return the key translated via the translation table.
+ Your application program should never depend on the values returned
+ by this method, but instead use symbolic keys (such as #FindNext).
+ Doing so allows easier reconfiguration by changing the translation map
+ in the 'smalltalk.rc' or 'display.rc' startup files.
+
+ First, the modifier is prepended, making character X into
+ AltX, CtrlX or CmdX (on many systems, no separate Cmd (or Meta)
+ key exists; on those we always get AltX if the metaModifiers are not set correctly).
+ If multiple modifiers are active, the symbol becoms the concatenation
+ as in AltCtrlq (for control-alt-q). Shift will affect the last component,
+ thus the above with shift becoms: AltCtrlQ instead.
+ Some keyboards offer both Alt and Meta keys - on those, the first has a
+ prefix of Alt, the second has Cmd as prefix. Keyboards with only an Alt
+ key will will create prefix codes of Cmd for that.
+ For symbolic keys (i.e.Tab, Backspace etc, shift is ignored).
+ 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 isCharacter ifFalse:[
xlatedKey := xlatedKey asSymbol
@@ -7070,6 +7080,6 @@
!DeviceWorkstation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.372 2000-07-11 13:41:20 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.373 2000-07-19 11:31:16 ca Exp $'
! !
DeviceWorkstation initialize!