DeviceWorkstation.st
changeset 8930 a7340d780f22
parent 8893 16d66d9e7e15
child 8960 d6383fb34194
--- a/DeviceWorkstation.st	Sun Dec 15 02:08:04 2019 +0100
+++ b/DeviceWorkstation.st	Sun Dec 15 03:49:58 2019 +0100
@@ -822,6 +822,28 @@
     ^ self subclassResponsibility
 ! !
 
+!DeviceWorkstation class methodsFor:'multi monitor support'!
+
+openViewWithBlock:openAction
+    view:aView  
+    at:origin
+
+    "
+        HACK for multi monitor support.
+        sub views needs to be opened on the same monitor as their top view,
+        so that Windows create/place them into the same virtual resolution/display.
+        after the sub views are opened we can move them within the same virtual resolution/display.
+        to their actually origin
+
+        USED BY WINDOWS ONLY
+    "
+
+    aView origin:origin.
+    openAction value.
+
+    "Created: / 28-11-2019 / 17:52:16 / Stefan Reise"
+! !
+
 !DeviceWorkstation class methodsFor:'queries'!
 
 allScreens
@@ -3046,19 +3068,19 @@
 
 verticalPixelPerInch
     "return the number of vertical pixels per inch of the display.
-     By default, this is computed from the height and heigthInMM infos,
+     By default, this is computed from the height and heightInMM infos,
      as returned by the system.
      However, some systems report this wrong,
      and also with mixed resolution monitors, we cannot depend on what
      is returned (happens when an additional external monitor is
      connected to a retina).
      Thus, you can override the resolution via:
-	Display verticalPixelPerMillimeter:pixels"
+        Display verticalPixelPerMillimeter:pixels"
 
     ^ self verticalPixelPerMillimeter * 25.4
 
     "
-	Display verticalPixelPerInch
+        Display verticalPixelPerInch
     "
 
     "Modified (comment): / 12-04-2018 / 16:45:47 / stefan"
@@ -3066,17 +3088,17 @@
 
 verticalPixelPerMillimeter
     "return the number of vertical pixels per millimeter of the display.
-     By default, this is computed from the height and heigthInMM infos,
+     By default, this is computed from the height and heightInMM infos,
      as returned by the system.
      However, some systems report this wrong,
      and also with mixed resolution monitors, we cannot depend on what
      is returned (happens when an additional external monitor is
      connected to a retina).
      Thus, you can override the resolution via:
-	Display verticalPixelPerMillimeter:pixels"
+        Display verticalPixelPerMillimeter:pixels"
 
     resolutionVer notNil ifTrue:[
-	^ resolutionVer
+        ^ resolutionVer
     ].
     resolutionVer := (height / heightMM) asFloat.
     ^ resolutionVer
@@ -3084,14 +3106,14 @@
 
 verticalPixelPerMillimeter:aNumber
     "set the number of vertical pixels per millimeter of the display.
-     By default, this is computed from the height and heigthInMM infos,
+     By default, this is computed from the height and heightInMM infos,
      as returned by the system.
      However, some systems report this wrong,
      and also with mixed resolution monitors, we cannot depend on what
      is returned (happens when an additional external monitor is
      connected to a retina).
      Thus, you can override the resolution via:
-	Display verticalPixelPerMillimeter:pixels"
+        Display verticalPixelPerMillimeter:pixels"
 
     resolutionVer := aNumber
 !
@@ -7373,24 +7395,30 @@
     "internal, private method.
      Called with every keyPress/keyRelease to update the xxxDown flags."
 
+    pressed isNil ifTrue:[
+        thisContext fullPrintAll.
+        self modifierKeyProcessing:key down:false.
+        ^ self
+    ].
+
     (altModifiers notNil and:[altModifiers includes:key]) ifTrue:[
-	altDown := pressed
+        altDown := pressed
     ] ifFalse:[
-	(metaModifiers notNil and:[metaModifiers includes:key]) ifTrue:[
-	    metaDown := pressed
-	] ifFalse:[
-	    (shiftModifiers notNil and:[shiftModifiers includes:key]) ifTrue:[
-		shiftDown := pressed.
-		(key == #'Shift_L') ifTrue:[leftShiftDown := pressed].
-		(key == #'Shift_R') ifTrue:[rightShiftDown := pressed].
-	    ] ifFalse:[
-		(ctrlModifiers notNil and:[ctrlModifiers includes:key]) ifTrue:[
-		    ctrlDown := pressed.
-		    (key == #'Control_L') ifTrue:[leftCtrlDown := pressed].
-		    (key == #'Control_R') ifTrue:[rightCtrlDown := pressed].
-		]
-	    ]
-	]
+        (metaModifiers notNil and:[metaModifiers includes:key]) ifTrue:[
+            metaDown := pressed
+        ] ifFalse:[
+            (shiftModifiers notNil and:[shiftModifiers includes:key]) ifTrue:[
+                shiftDown := pressed.
+                (key == #'Shift_L') ifTrue:[leftShiftDown := pressed].
+                (key == #'Shift_R') ifTrue:[rightShiftDown := pressed].
+            ] ifFalse:[
+                (ctrlModifiers notNil and:[ctrlModifiers includes:key]) ifTrue:[
+                    ctrlDown := pressed.
+                    (key == #'Control_L') ifTrue:[leftCtrlDown := pressed].
+                    (key == #'Control_R') ifTrue:[rightCtrlDown := pressed].
+                ]
+            ]
+        ]
     ]
 
     "Modified: / 02-01-1996 / 15:00:25 / cg"
@@ -7638,7 +7666,7 @@
 altDown
     "return true, if the alt-key is currently pressed."
 
-    ^ altDown
+    ^ altDown ? false
 !
 
 altModifierMask
@@ -7652,7 +7680,7 @@
     "return true, if the control-key is currently pressed.
      Here, we don't differentiate between left and right ctrl keys."
 
-    ^ ctrlDown
+    ^ ctrlDown ? false
 
     "Modified (comment): / 19-07-2019 / 09:00:14 / Claus Gittinger"
 !
@@ -7667,7 +7695,7 @@
 leftCtrlDown
     "return true, if the left control-key is currently pressed."
 
-    ^ leftCtrlDown
+    ^ leftCtrlDown ? false
 
     "Created: / 19-07-2019 / 09:00:29 / Claus Gittinger"
 !
@@ -7675,17 +7703,24 @@
 leftShiftDown
     "return true, if the left shift-key is currently pressed."
 
-    ^ leftShiftDown
+    ^ leftShiftDown ? false
 
     "Created: / 09-11-1996 / 19:06:48 / cg"
     "Modified: / 19-07-2019 / 08:56:18 / Claus Gittinger"
+
+    "
+     10 timesRepeat:[
+        Transcript showCR:'l:%1 r:%2' with:Display leftShiftDown with:Display rightShiftDown.
+        Delay waitForSeconds:1.
+     ]
+    "
 !
 
 metaDown
     "return true, if the meta-key (alt-key on systems without meta)
      is currently pressed."
 
-    ^ metaDown
+    ^ metaDown ? false
 !
 
 metaModifierMask
@@ -7698,7 +7733,7 @@
 rightCtrlDown
     "return true, if the right control-key is currently pressed."
 
-    ^ rightCtrlDown
+    ^ rightCtrlDown ? false
 
     "Created: / 19-07-2019 / 09:00:39 / Claus Gittinger"
 !
@@ -7706,7 +7741,7 @@
 rightShiftDown
     "return true, if the right shift-key is currently pressed"
 
-    ^ rightShiftDown
+    ^ rightShiftDown ? false
 
     "Created: / 09-11-1996 / 19:06:56 / cg"
     "Modified (comment): / 19-07-2019 / 08:59:36 / Claus Gittinger"
@@ -7716,7 +7751,7 @@
     "return true, if the shift-key is currently pressed.
      Here, we don't differentiate between left and right shift keys."
 
-    ^ shiftDown
+    ^ shiftDown ? false
 
     "Modified (comment): / 19-07-2019 / 08:59:42 / Claus Gittinger"
 !