#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Fri, 19 Jul 2019 09:01:47 +0200
changeset 8738 5a3816487f54
parent 8737 fd96d20ea1b5
child 8739 b3a481b51d1b
#FEATURE by cg class: DeviceWorkstation added: #leftCtrlDown #rightCtrlDown comment/format in: #ctrlDown #shiftDown variable renamed in: #leftShiftDown #rightShiftDown changed: #initializeDefaultValues #modifierKeyProcessing:down:
DeviceWorkstation.st
--- a/DeviceWorkstation.st	Thu Jul 18 21:55:46 2019 +0200
+++ b/DeviceWorkstation.st	Fri Jul 19 09:01:47 2019 +0200
@@ -20,18 +20,17 @@
 		bitsBlue redMask greenMask blueMask redShift greenShift blueShift
 		hasColors hasGreyscales width height widthMM heightMM
 		resolutionHor resolutionVer lastId lastView knownViews
-		dispatching dispatchProcess exitOnLastClose
-		ctrlDown leftCtrlDown rightCtrlDown
-		shiftDown leftShiftDown rightShiftDown
-		metaDown altDown superDown motionEventCompression keyboardMap
-		rootView isSlow activeKeyboardGrab activePointerGrab
-		buttonTranslation multiClickTimeDelta altModifiers metaModifiers
-		ctrlModifiers shiftModifiers superModifiers buttonModifiers
-		supportsDeepIcons preferredIconSize ditherColors fixColors
-		numFixRed numFixGreen numFixBlue fixGrayColors copyBuffer
-		blackColor whiteColor focusMode activeView clipBoardEncoding
-		maxClipBoardSize focusView focusWindowGroup deviceErrorSignal
-		deviceIOErrorSignal mayOpenDebugger suppressDebugger eventSema
+		dispatching dispatchProcess exitOnLastClose ctrlDown leftCtrlDown
+		rightCtrlDown shiftDown leftShiftDown rightShiftDown metaDown
+		altDown superDown motionEventCompression keyboardMap rootView
+		isSlow activeKeyboardGrab activePointerGrab buttonTranslation
+		multiClickTimeDelta altModifiers metaModifiers ctrlModifiers
+		shiftModifiers superModifiers buttonModifiers supportsDeepIcons
+		preferredIconSize ditherColors fixColors numFixRed numFixGreen
+		numFixBlue fixGrayColors copyBuffer blackColor whiteColor
+		focusMode activeView clipBoardEncoding maxClipBoardSize focusView
+		focusWindowGroup deviceErrorSignal deviceIOErrorSignal
+		mayOpenDebugger suppressDebugger eventSema
 		buttonLongPressedHandlerProcess buttonPressTimeForMenu
 		aboutToOpenModalWindowHooks aboutToOpenNonModalWindowHooks'
 	classVariableNames:'AllScreens ButtonTranslation CopyBufferHistory
@@ -6323,17 +6322,19 @@
     isSlow := false.
     motionEventCompression := true.
     buttonTranslation isNil ifTrue:[
-	buttonTranslation := ButtonTranslation.
+        buttonTranslation := ButtonTranslation.
     ].
     multiClickTimeDelta isNil ifTrue:[
-	multiClickTimeDelta := MultiClickTimeDelta.
-    ].
-    shiftDown := false.
-    ctrlDown := false.
+        multiClickTimeDelta := MultiClickTimeDelta.
+    ].
+    shiftDown := leftShiftDown := rightShiftDown := false.
+    ctrlDown := leftCtrlDown := rightCtrlDown := false.
     metaDown := false.
     altDown := false.
 
     self initializeModifierMappings
+
+    "Modified: / 19-07-2019 / 08:56:07 / Claus Gittinger"
 !
 
 initializeDeviceResources
@@ -7102,22 +7103,27 @@
      Called with every keyPress/keyRelease to update the xxxDown flags."
 
     (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
-	    ] ifFalse:[
-		(ctrlModifiers notNil and:[ctrlModifiers includes:key]) ifTrue:[
-		    ctrlDown := 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: 2.1.1996 / 15:00:25 / cg"
+    "Modified: / 02-01-1996 / 15:00:25 / cg"
+    "Modified: / 19-07-2019 / 08:59:09 / Claus Gittinger"
 !
 
 modifierKeyTopFor:key
@@ -7362,9 +7368,12 @@
 !
 
 ctrlDown
-    "return true, if the control-key is currently pressed."
+    "return true, if the control-key is currently pressed.
+     Here, we don't differentiate between left and right ctrl keys."
 
     ^ ctrlDown
+
+    "Modified (comment): / 19-07-2019 / 09:00:14 / Claus Gittinger"
 !
 
 ctrlModifierMask
@@ -7374,13 +7383,21 @@
 
 !
 
+leftCtrlDown
+    "return true, if the left control-key is currently pressed."
+
+    ^ leftCtrlDown
+
+    "Created: / 19-07-2019 / 09:00:29 / Claus Gittinger"
+!
+
 leftShiftDown
-    "return true, if the left shift-key is currently pressed.
-     Here, we don't differentiate between left and right shift keys."
-
-    ^ shiftDown
-
-    "Created: 9.11.1996 / 19:06:48 / cg"
+    "return true, if the left shift-key is currently pressed."
+
+    ^ leftShiftDown
+
+    "Created: / 09-11-1996 / 19:06:48 / cg"
+    "Modified: / 19-07-2019 / 08:56:18 / Claus Gittinger"
 !
 
 metaDown
@@ -7397,19 +7414,30 @@
 
 !
 
+rightCtrlDown
+    "return true, if the right control-key is currently pressed."
+
+    ^ rightCtrlDown
+
+    "Created: / 19-07-2019 / 09:00:39 / Claus Gittinger"
+!
+
 rightShiftDown
-    "return true, if the right shift-key is currently pressed.
+    "return true, if the right shift-key is currently pressed"
+
+    ^ rightShiftDown
+
+    "Created: / 09-11-1996 / 19:06:56 / cg"
+    "Modified (comment): / 19-07-2019 / 08:59:36 / Claus Gittinger"
+!
+
+shiftDown
+    "return true, if the shift-key is currently pressed.
      Here, we don't differentiate between left and right shift keys."
 
     ^ shiftDown
 
-    "Created: 9.11.1996 / 19:06:56 / cg"
-!
-
-shiftDown
-    "return true, if the shift-key is currently pressed."
-
-    ^ shiftDown
+    "Modified (comment): / 19-07-2019 / 08:59:42 / Claus Gittinger"
 !
 
 shiftModifierMask