more on modifiers
authorClaus Gittinger <cg@exept.de>
Tue, 02 Jan 1996 15:49:32 +0100
changeset 342 a52a4e45a294
parent 341 47ac178c3924
child 343 f5d86df5c66b
more on modifiers
XWorkstat.st
XWorkstation.st
--- a/XWorkstat.st	Tue Jan 02 15:10:57 1996 +0100
+++ b/XWorkstat.st	Tue Jan 02 15:49:32 1996 +0100
@@ -5142,24 +5142,41 @@
     altModifierMask := metaModifierMask := nil.
 
     map := self modifierMapping.
-
-    mod := map at:1.
-    mod notNil ifTrue:[
-	shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
-    ].
-    mod := map at:3.
-    mod notNil ifTrue:[
-	ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
-    ].
-    mod := map at:4.
-    mod notNil ifTrue:[
-	metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
-	metaModifierMask := 1 bitShift:(4-1).
-    ].
-    mod := map at:5.
-    mod notNil ifTrue:[
-	altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
-	altModifierMask := 1 bitShift:(5-1).
+    map isNil ifTrue:[
+	"/
+	"/ mhmh - a crippled Xlib which does not provide modifier mappings
+	"/ setup some reasonable default. If that is not sufficient,
+	"/ you have to change things from your display.rc file.
+	"/
+	altModifierMask := self modifier1Mask.
+	metaModifierMask := self modifier2Mask.
+
+	shiftModifiers := #(Shift_L Shift_R Shift).
+	ctrlModifiers := #(Control_L Control_R Control).
+	metaModifiers := #(Alt_L Meta_L Meta_R Meta).
+	altModifiers := #(Alt_R Alt).
+    ] ifFalse:[
+	altModifierMask := 0.
+        metaModifierMask := 0.
+
+        mod := map at:1.
+        mod notNil ifTrue:[
+	    shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:3.
+        mod notNil ifTrue:[
+	    ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:4.
+        mod notNil ifTrue:[
+	    metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
+	    metaModifierMask := 1 bitShift:(4-1).
+        ].
+        mod := map at:5.
+        mod notNil ifTrue:[
+	    altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
+	    altModifierMask := 1 bitShift:(5-1).
+	]
     ].
 
     "Modified: 1.12.1995 / 23:44:40 / stefan"
@@ -7071,6 +7088,6 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.94 1996-01-02 14:10:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.95 1996-01-02 14:49:32 cg Exp $'
 ! !
 XWorkstation initialize!
--- a/XWorkstation.st	Tue Jan 02 15:10:57 1996 +0100
+++ b/XWorkstation.st	Tue Jan 02 15:49:32 1996 +0100
@@ -5142,24 +5142,41 @@
     altModifierMask := metaModifierMask := nil.
 
     map := self modifierMapping.
-
-    mod := map at:1.
-    mod notNil ifTrue:[
-	shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
-    ].
-    mod := map at:3.
-    mod notNil ifTrue:[
-	ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
-    ].
-    mod := map at:4.
-    mod notNil ifTrue:[
-	metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
-	metaModifierMask := 1 bitShift:(4-1).
-    ].
-    mod := map at:5.
-    mod notNil ifTrue:[
-	altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
-	altModifierMask := 1 bitShift:(5-1).
+    map isNil ifTrue:[
+	"/
+	"/ mhmh - a crippled Xlib which does not provide modifier mappings
+	"/ setup some reasonable default. If that is not sufficient,
+	"/ you have to change things from your display.rc file.
+	"/
+	altModifierMask := self modifier1Mask.
+	metaModifierMask := self modifier2Mask.
+
+	shiftModifiers := #(Shift_L Shift_R Shift).
+	ctrlModifiers := #(Control_L Control_R Control).
+	metaModifiers := #(Alt_L Meta_L Meta_R Meta).
+	altModifiers := #(Alt_R Alt).
+    ] ifFalse:[
+	altModifierMask := 0.
+        metaModifierMask := 0.
+
+        mod := map at:1.
+        mod notNil ifTrue:[
+	    shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:3.
+        mod notNil ifTrue:[
+	    ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:4.
+        mod notNil ifTrue:[
+	    metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
+	    metaModifierMask := 1 bitShift:(4-1).
+        ].
+        mod := map at:5.
+        mod notNil ifTrue:[
+	    altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
+	    altModifierMask := 1 bitShift:(5-1).
+	]
     ].
 
     "Modified: 1.12.1995 / 23:44:40 / stefan"
@@ -7071,6 +7088,6 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.94 1996-01-02 14:10:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.95 1996-01-02 14:49:32 cg Exp $'
 ! !
 XWorkstation initialize!